summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Lapenkou <lapenkov@fb.com>2022-03-24 18:07:27 -0700
committerAlexander Lapenkov <lapenkov.a@yandex.ru>2022-03-24 22:05:35 -0700
commita93931537e3845c8baca6965aded9a9683fa1481 (patch)
tree28c2e3357cc85efc2832664f97e0147ee981c148
parenteaaa368bab472a78e99a25c1641d24ad3c2283ad (diff)
downloadjemalloc-a93931537e3845c8baca6965aded9a9683fa1481.tar.gz
Do not disable SEC by default for 64k pages platforms
Default SEC max_alloc option value was 32k, disabling SEC for platforms with lg-page=16. This change enables SEC for all platforms, making minimum max_alloc value equal to PAGE.
-rw-r--r--include/jemalloc/internal/sec_opts.h2
-rw-r--r--src/sec.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/jemalloc/internal/sec_opts.h b/include/jemalloc/internal/sec_opts.h
index 91b6d0de..a3ad72fb 100644
--- a/include/jemalloc/internal/sec_opts.h
+++ b/include/jemalloc/internal/sec_opts.h
@@ -46,7 +46,7 @@ struct sec_opts_s {
/* nshards */ \
4, \
/* max_alloc */ \
- 32 * 1024, \
+ (32 * 1024) < PAGE ? PAGE : (32 * 1024), \
/* max_bytes */ \
256 * 1024, \
/* bytes_after_flush */ \
diff --git a/src/sec.c b/src/sec.c
index c13904d8..df675590 100644
--- a/src/sec.c
+++ b/src/sec.c
@@ -23,7 +23,7 @@ sec_bin_init(sec_bin_t *bin) {
bool
sec_init(tsdn_t *tsdn, sec_t *sec, base_t *base, pai_t *fallback,
const sec_opts_t *opts) {
- assert(opts->max_alloc > 0);
+ assert(opts->max_alloc >= PAGE);
size_t max_alloc = PAGE_FLOOR(opts->max_alloc);
pszind_t npsizes = sz_psz2ind(max_alloc) + 1;