Minor cleanup and perf improvement
This commit is contained in:
@@ -73,8 +73,6 @@ void *ucl_arena_get(struct ucl_arena *arena) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int total_arena_puts = 0;
|
|
||||||
|
|
||||||
void ucl_arena_put(struct ucl_arena *arena, void *object) {
|
void ucl_arena_put(struct ucl_arena *arena, void *object) {
|
||||||
if (object == NULL) {
|
if (object == NULL) {
|
||||||
return;
|
return;
|
||||||
@@ -87,9 +85,7 @@ void ucl_arena_put(struct ucl_arena *arena, void *object) {
|
|||||||
|
|
||||||
assert(offset % arena->object_size == 0);
|
assert(offset % arena->object_size == 0);
|
||||||
assert(index < arena->capacity);
|
assert(index < arena->capacity);
|
||||||
|
|
||||||
assert(arena->used_map[int_index] & (1 << bit_index));
|
assert(arena->used_map[int_index] & (1 << bit_index));
|
||||||
total_arena_puts++;
|
|
||||||
|
|
||||||
arena->used_map[int_index] &= ~(1 << bit_index);
|
arena->used_map[int_index] &= ~(1 << bit_index);
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ struct ucl_object *ucl_scope_get(struct ucl *state, struct ucl_scope *scope, con
|
|||||||
scope = scope->parent;
|
scope = scope->parent;
|
||||||
cell = ucl_scope_get_cell(scope, name);
|
cell = ucl_scope_get_cell(scope, name);
|
||||||
}
|
}
|
||||||
return ucl_list_nth(cell, DATA_POSITION);
|
// This code is a little hot. No error checking.
|
||||||
|
return cell->cell.cdr->cell.car;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ucl_scope_put(struct ucl *state, struct ucl_scope *scope, const char *name, struct ucl_object *obj) {
|
void ucl_scope_put(struct ucl *state, struct ucl_scope *scope, const char *name, struct ucl_object *obj) {
|
||||||
|
|||||||
Reference in New Issue
Block a user