aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-03-10 14:53:29 +0100
committerSverker Eriksson <[email protected]>2011-03-10 14:53:29 +0100
commit27e6ebe3eaf9186e797e3a334d85f64e9ddb37ec (patch)
treeb7b1df00b2f67b3b7836a961cb385d3405dcc8a3 /erts/emulator/beam/erl_db.c
parent0213def22b5ab6f145a5529f9bbef0d26124abaf (diff)
parent4a09d6252e6fca9ed07c479ce16717085969d998 (diff)
downloadotp-27e6ebe3eaf9186e797e3a334d85f64e9ddb37ec.tar.gz
otp-27e6ebe3eaf9186e797e3a334d85f64e9ddb37ec.tar.bz2
otp-27e6ebe3eaf9186e797e3a334d85f64e9ddb37ec.zip
Merge branch 'sverker/valgrind-new-suppressions' into dev
* sverker/valgrind-new-suppressions: Make halfword emulator with valgrind target allocate low memory Add erts_alloc_permanent_cache_aligned to supress valgrind
Diffstat (limited to 'erts/emulator/beam/erl_db.c')
-rw-r--r--erts/emulator/beam/erl_db.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/erts/emulator/beam/erl_db.c b/erts/emulator/beam/erl_db.c
index 5b74240cc3..61e8a595be 100644
--- a/erts/emulator/beam/erl_db.c
+++ b/erts/emulator/beam/erl_db.c
@@ -2773,17 +2773,10 @@ void init_db(void)
rwmtx_opt.type = ERTS_SMP_RWMTX_TYPE_FREQUENT_READ;
rwmtx_opt.lived = ERTS_SMP_RWMTX_LONG_LIVED;
- meta_main_tab_locks = erts_alloc(ERTS_ALC_T_DB_TABLES,
- (sizeof(erts_meta_main_tab_lock_t)
- * (ERTS_META_MAIN_TAB_LOCK_TAB_SIZE+1)));
-
- if ((((UWord) meta_main_tab_locks) & ERTS_CACHE_LINE_MASK) != 0)
- meta_main_tab_locks = ((erts_meta_main_tab_lock_t *)
- ((((UWord) meta_main_tab_locks)
- & ~ERTS_CACHE_LINE_MASK)
- + ERTS_CACHE_LINE_SIZE));
-
- ASSERT((((UWord) meta_main_tab_locks) & ERTS_CACHE_LINE_MASK) == 0);
+ meta_main_tab_locks =
+ erts_alloc_permanent_cache_aligned(ERTS_ALC_T_DB_TABLES,
+ sizeof(erts_meta_main_tab_lock_t)
+ * ERTS_META_MAIN_TAB_LOCK_TAB_SIZE);
for (i = 0; i < ERTS_META_MAIN_TAB_LOCK_TAB_SIZE; i++) {
erts_smp_rwmtx_init_opt_x(&meta_main_tab_locks[i].rwmtx, &rwmtx_opt,