mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
optimize malloc_usable_size enforce_init
This commit is contained in:
parent
178d4f320f
commit
0bf18b7c26
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue