mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-06 00:05:15 -04:00
add initial malloc_object_size extensions
This commit is contained in:
parent
00b2613e16
commit
2684a98eab
2 changed files with 42 additions and 1 deletions
8
malloc.h
8
malloc.h
|
@ -48,4 +48,12 @@ void *h_valloc(size_t size);
|
|||
void *h_pvalloc(size_t size);
|
||||
void h_cfree(void *ptr);
|
||||
|
||||
// custom extensions
|
||||
|
||||
// return an upper bound on object size for any pointer based on malloc metadata
|
||||
size_t h_malloc_object_size(void *ptr);
|
||||
|
||||
// similar to malloc_object_size, but avoiding locking so the results are much more limited
|
||||
size_t h_malloc_object_size_fast(void *ptr);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue