Rename be_map_release to be_map_compact

This commit is contained in:
Stephan Hadinger 2021-12-04 13:49:06 +01:00
parent bcbef695ce
commit 888cbb999d
7 changed files with 8 additions and 8 deletions

View File

@ -51,7 +51,7 @@ static void class_init(bvm *vm, bclass *c, const bnfuncinfo *lib)
++slib;
}
}
be_map_release(vm, c->members); /* clear space */
be_map_compact(vm, c->members); /* clear space */
}
}

View File

@ -40,7 +40,7 @@ bclass* be_newclass(bvm *vm, bstring *name, bclass *super)
void be_class_compress(bvm *vm, bclass *c)
{
if (!gc_isconst(c) && c->members) {
be_map_release(vm, c->members); /* clear space */
be_map_compact(vm, c->members); /* clear space */
}
}

View File

@ -343,7 +343,7 @@ bmapnode* be_map_val2node(bvalue *value)
return (bmapnode *)((size_t)value - sizeof(bmapkey));
}
void be_map_release(bvm *vm, bmap *map)
void be_map_compact(bvm *vm, bmap *map)
{
(void)vm;
if (!gc_isconst(map)) {

View File

@ -56,6 +56,6 @@ bvalue* be_map_insertstr(bvm *vm, bmap *map, bstring *key, bvalue *value);
void be_map_removestr(bvm *vm, bmap *map, bstring *key);
bmapnode* be_map_next(bmap *map, bmapiter *iter);
bmapnode* be_map_val2node(bvalue *value);
void be_map_release(bvm *vm, bmap *map);
void be_map_compact(bvm *vm, bmap *map);
#endif

View File

@ -99,7 +99,7 @@ static bmodule* new_module(bvm *vm, const bntvmodule *nm)
obj->table = NULL; /* gc protection */
obj->table = be_map_new(vm);
insert_attrs(vm, obj->table, nm);
be_map_release(vm, obj->table); /* clear space */
be_map_compact(vm, obj->table); /* clear space */
be_stackpop(vm, 1);
}
return obj;

View File

@ -42,7 +42,7 @@ static void m_solidify_bvalue(bvm *vm, bvalue * value, const char *classname, co
static void m_solidify_map(bvm *vm, bmap * map, const char *class_name)
{
// compact first
be_map_release(vm, map);
be_map_compact(vm, map);
logfmt(" be_nested_map(%i,\n", map->count);

View File

@ -87,7 +87,7 @@ bvalue* be_global_var(bvm *vm, int index)
void be_global_release_space(bvm *vm)
{
be_map_release(vm, global(vm).vtab);
be_map_compact(vm, global(vm).vtab);
be_vector_release(vm, &global(vm).vlist);
}
@ -130,7 +130,7 @@ int be_builtin_new(bvm *vm, bstring *name)
void be_bulitin_release_space(bvm *vm)
{
be_map_release(vm, builtin(vm).vtab);
be_map_compact(vm, builtin(vm).vtab);
be_vector_release(vm, &builtin(vm).vlist);
}
#else