mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-30 16:47:29 +03:00
Add nallocm().
Add nallocm(), which computes the real allocation size that would result from the corresponding allocm() call. nallocm() is a functional superset of OS X's malloc_good_size(), in that it takes alignment constraints into account.
This commit is contained in:
parent
4bb0983013
commit
7e15dab94d
5 changed files with 131 additions and 25 deletions
|
|
@ -548,10 +548,6 @@ sa2u(size_t size, size_t alignment, size_t *run_size_p)
|
|||
* 96 | 1100000 | 32
|
||||
* 144 | 10100000 | 32
|
||||
* 192 | 11000000 | 64
|
||||
*
|
||||
* Depending on runtime settings, it is possible that arena_malloc()
|
||||
* will further round up to a power of two, but that never causes
|
||||
* correctness issues.
|
||||
*/
|
||||
usize = (size + (alignment - 1)) & (-alignment);
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ int JEMALLOC_P(rallocm)(void **ptr, size_t *rsize, size_t size,
|
|||
int JEMALLOC_P(sallocm)(const void *ptr, size_t *rsize, int flags)
|
||||
JEMALLOC_ATTR(nonnull(1));
|
||||
int JEMALLOC_P(dallocm)(void *ptr, int flags) JEMALLOC_ATTR(nonnull(1));
|
||||
int JEMALLOC_P(nallocm)(size_t *rsize, size_t size, int flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue