summaryrefslogtreecommitdiff
path: root/libc/private/bionic_allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/private/bionic_allocator.h')
-rw-r--r--libc/private/bionic_allocator.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/private/bionic_allocator.h b/libc/private/bionic_allocator.h
index c705ce403..342fd5149 100644
--- a/libc/private/bionic_allocator.h
+++ b/libc/private/bionic_allocator.h
@@ -110,6 +110,11 @@ class BionicAllocator {
// Note that this implementation of realloc never shrinks allocation
void* realloc(void* ptr, size_t size);
void free(void* ptr);
+
+ // Returns the size of the given allocated heap chunk, if it is valid.
+ // Otherwise, this may return 0 or cause a segfault if the pointer is invalid.
+ size_t get_chunk_size(void* ptr);
+
private:
void* alloc_mmap(size_t align, size_t size);
inline void* alloc_impl(size_t align, size_t size);