Avoid potential issues on extent zero-out.

When custom extent_hooks or transparent huge pages are in use, the purging
semantics may change, which means we may not get zeroed pages on repopulating.
Fixing the issue by manually memset for such cases.
This commit is contained in:
Qi Wang
2018-08-10 16:08:50 -07:00
committed by Qi Wang
parent 0ecd5addb1
commit f459454afe
2 changed files with 26 additions and 4 deletions

View File

@@ -8,6 +8,11 @@
#include "jemalloc/internal/sz.h"
#include "jemalloc/internal/ticker.h"
JEMALLOC_ALWAYS_INLINE bool
arena_has_default_hooks(arena_t *arena) {
return (extent_hooks_get(arena) == &extent_hooks_default);
}
JEMALLOC_ALWAYS_INLINE arena_t *
arena_choose_maybe_huge(tsd_t *tsd, arena_t *arena, size_t size) {
if (arena != NULL) {