Implement opt.cache_oblivious.

Keep config.cache_oblivious for now to remain backward-compatible.
This commit is contained in:
Qi Wang
2021-02-09 22:24:35 -08:00
committed by Qi Wang
parent 8c5e5f50a2
commit a11be50332
12 changed files with 53 additions and 27 deletions

View File

@@ -33,6 +33,7 @@ extern zero_realloc_action_t opt_zero_realloc_action;
extern malloc_init_t malloc_init_state;
extern const char *zero_realloc_mode_names[];
extern atomic_zu_t zero_realloc_count;
extern bool opt_cache_oblivious;
/* Number of CPUs. */
extern unsigned ncpus;

View File

@@ -223,7 +223,7 @@ prof_sample_align(size_t orig_align) {
* w/o metadata lookup.
*/
assert(opt_prof);
return (config_cache_oblivious && orig_align < PAGE) ? PAGE :
return (opt_cache_oblivious && orig_align < PAGE) ? PAGE :
orig_align;
}

View File

@@ -45,15 +45,13 @@ extern size_t sz_index2size_tab[SC_NSIZES];
*/
extern uint8_t sz_size2index_tab[];
static const size_t sz_large_pad =
#ifdef JEMALLOC_CACHE_OBLIVIOUS
PAGE
#else
0
#endif
;
/*
* Padding for large allocations: PAGE when opt_cache_oblivious == true (to
* enable cache index randomization); 0 otherwise.
*/
extern size_t sz_large_pad;
extern void sz_boot(const sc_data_t *sc_data);
extern void sz_boot(const sc_data_t *sc_data, bool cache_oblivious);
JEMALLOC_ALWAYS_INLINE pszind_t
sz_psz2ind(size_t psz) {