Skip to content

Commit

Permalink
optimize malloc_usable_size enforce_init
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Oct 3, 2020
1 parent 178d4f3 commit 0bf18b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,6 @@ EXPORT size_t h_malloc_usable_size(H_MALLOC_USABLE_SIZE_CONST void *p) {
return 0;
}

enforce_init();
thread_unseal_metadata();

if (p < get_slab_region_end() && p >= ro.slab_region_start) {
Expand All @@ -1623,6 +1622,7 @@ EXPORT size_t h_malloc_usable_size(H_MALLOC_USABLE_SIZE_CONST void *p) {
return size ? size - canary_size : 0;
}

enforce_init();
struct region_allocator *ra = ro.region_allocator;
mutex_lock(&ra->lock);
struct region_metadata *region = regions_find(p);
Expand Down

0 comments on commit 0bf18b7

Please sign in to comment.