summaryrefslogtreecommitdiff
path: root/libc/private/bionic_allocator.h
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
committerJustin DeMartino <jjdemartino@google.com>2020-09-21 13:23:58 -0700
commit7e4fe6a28b718ab97c08811566238af2893ca65b (patch)
tree5413a5ec890b5a1ac4fbbe4548b5014e41a2591b /libc/private/bionic_allocator.h
parentdcdcb3fa15004669823a3a118189d9d72ff30852 (diff)
parentab08b955a34423d53b28a6210e7530e67241af4a (diff)
Merge SP1A.200921.001
Change-Id: Id2ab019914bb555dadf52c46b8403c0d5fb3c20a
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);