about summary refs log tree commit diff
path: root/src/malloc/malloc_usable_size.c
Commit message (Collapse)AuthorAgeFilesLines
* move oldmalloc to its own directory under src/mallocRich Felker2020-06-031-9/+0
| | | | | | | | | | | | | this sets the stage for replacement, and makes it practical to keep oldmalloc around as a build option for a while if that ends up being useful. only the files which are actually part of the implementation are moved. memalign and posix_memalign are entirely generic. in theory calloc could be pulled out too, but it's useful to have it tied to the implementation so as to optimize out unnecessary memset when implementation details make it possible to know the memory is already clear.
* hide dependency-triggering pointer object in malloc_usable_size.cRich Felker2018-09-121-2/+2
|
* rework malloc_usable_size to use malloc_impl.hRich Felker2018-09-121-9/+1
|
* fix malloc_usable_size for NULL inputSzabolcs Nagy2016-01-311-1/+1
| | | | | | the linux man page specifies malloc_usable_size(0) to return 0 and this is the semantics other implementations follow (jemalloc). reported by Alexander Monakov.
* add malloc_usable_size function and non-stub malloc.hRich Felker2014-08-251-0/+17
this function is needed for some important practical applications of ABI compatibility, and may be useful for supporting some non-portable software at the source level too. I was hesitant to add a function which imposes any constraints on malloc internals; however, it turns out that any malloc implementation which has realloc must already have an efficient way to determine the size of existing allocations, so no additional constraint is imposed. for now, some internal malloc definitions are duplicated in the new source file. if/when malloc is refactored to put them in a shared internal header file, these could be removed. since malloc_usable_size is conventionally declared in malloc.h, the empty stub version of this file was no longer suitable. it's updated to provide the standard allocator functions, nonstandard ones (even if stdlib.h would not expose them based on the feature test macros in effect), and any malloc-extension functions provided (currently, only malloc_usable_size).