mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-02 18:17:54 +03:00
Check for NULL ptr in malloc_usable_size().
Check for NULL ptr in malloc_usable_size(), rather than just asserting that ptr is non-NULL. This matches behavior of other implementations (e.g., glibc and tcmalloc).
This commit is contained in:
parent
5b3db098f7
commit
2465bdf493
1 changed files with 2 additions and 4 deletions
|
|
@ -1230,10 +1230,8 @@ je_malloc_usable_size(const void *ptr)
|
|||
|
||||
if (config_ivsalloc)
|
||||
ret = ivsalloc(ptr);
|
||||
else {
|
||||
assert(ptr != NULL);
|
||||
ret = isalloc(ptr);
|
||||
}
|
||||
else
|
||||
ret = (ptr != NULL) ? isalloc(ptr) : 0;
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue