Merge pull request #16082 from s-hadinger/berry_remove_registry

Berry remove unused registry code
This commit is contained in:
s-hadinger 2022-07-26 10:07:18 +02:00 committed by GitHub
commit 7d21aaeab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 33 deletions

View File

@ -1142,29 +1142,3 @@ BERRY_API bbool be_isge(bvm *vm)
be_assert(vm->reg + 2 <= vm->top);
return be_vm_isge(vm, vm->top - 2, vm->top - 1);
}
BERRY_API int be_register(bvm *vm, int index)
{
bvalue *v;
if (!vm->registry) {
vm->registry = be_list_new(vm);
be_list_pool_init(vm, vm->registry);
}
be_assert(vm->registry != NULL);
v = be_indexof(vm, index);
return be_list_pool_alloc(vm, vm->registry, v);
}
BERRY_API void be_unregister(bvm *vm, int id)
{
be_assert(vm->registry != NULL);
be_list_pool_free(vm->registry, id);
}
BERRY_API void be_getregister(bvm *vm, int id)
{
blist *reg = vm->registry;
be_assert(reg && id > 0 && id < be_list_count(reg));
var_setval(vm->top, be_list_at(reg, id));
be_incrtop(vm);
}

View File

@ -370,7 +370,6 @@ static void premark_internal(bvm *vm)
mark_gray(vm, gc_object(vm->module.loaded));
mark_gray(vm, gc_object(vm->module.path));
mark_gray(vm, gc_object(vm->ntvclass));
mark_gray(vm, gc_object(vm->registry));
#if BE_USE_DEBUG_HOOK
if (be_isgcobj(&vm->hook)) {
mark_gray(vm, gc_object(var_toobj(&vm->hook)));

View File

@ -102,7 +102,6 @@ struct bvm {
struct bstringtable strtab; /* short string table */
bstack tracestack; /* call state trace-stack */
bmap *ntvclass; /* native class table */
blist *registry; /* registry list */
struct bgc gc;
bctypefunc ctypefunc; /* handler to ctype_func */
bbyte compopt; /* compilation options */

View File

@ -580,11 +580,6 @@ BERRY_API void be_module_path_set(bvm *vm, const char *path);
BERRY_API void* be_pushbytes(bvm *vm, const void *buf, size_t len);
BERRY_API const void* be_tobytes(bvm *vm, int index, size_t *len);
/* registry operation */
BERRY_API int be_register(bvm *vm, int index);
BERRY_API void be_unregister(bvm *vm, int id);
BERRY_API void be_getregister(bvm *vm, int id);
/* debug APIs */
BERRY_API void be_sethook(bvm *vm, const char *mask);
BERRY_API void be_setntvhook(bvm *vm, bntvhook hook, void *data, int mask);