mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-06 22:07:17 +03:00
extent_may_dalloc -> ehooks_dalloc_will_fail
This commit is contained in:
parent
7859184179
commit
09475bf8ac
2 changed files with 11 additions and 7 deletions
|
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#include "jemalloc/internal/atomic.h"
|
||||
#include "jemalloc/internal/extent_mmap.h"
|
||||
|
||||
extern const extent_hooks_t ehooks_default_extent_hooks;
|
||||
|
||||
|
|
@ -96,6 +97,15 @@ ehooks_are_default(ehooks_t *ehooks) {
|
|||
* a hook. If that hook is doomed to fail, this is wasteful. We therefore
|
||||
* include some checks for such cases.
|
||||
*/
|
||||
static inline bool
|
||||
ehooks_dalloc_will_fail(ehooks_t *ehooks) {
|
||||
if (ehooks_are_default(ehooks)) {
|
||||
return opt_retain;
|
||||
} else {
|
||||
return ehooks_get_extent_hooks_ptr(ehooks)->dalloc == NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ehooks_split_will_fail(ehooks_t *ehooks) {
|
||||
return ehooks_get_extent_hooks_ptr(ehooks)->split == NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue