diff options
author | Sverker Eriksson <[email protected]> | 2011-03-02 18:29:36 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2011-03-03 17:20:06 +0100 |
commit | cf9bb9e1e5f1cf58e88b8949b1124b0f160d25fe (patch) | |
tree | 0408e86c8b0e7beac92ad304964ff93beb1ec9aa /erts/emulator/beam/erl_db.c | |
parent | 8c4ece5c36e153e739f344eccadd01b4c3e7ccce (diff) | |
download | otp-cf9bb9e1e5f1cf58e88b8949b1124b0f160d25fe.tar.gz otp-cf9bb9e1e5f1cf58e88b8949b1124b0f160d25fe.tar.bz2 otp-cf9bb9e1e5f1cf58e88b8949b1124b0f160d25fe.zip |
Add erts_alloc_permanent_cache_aligned to supress valgrind
Ease the valgrind supression of memory that are permanently
allocated and then aligned up to cache line.
Diffstat (limited to 'erts/emulator/beam/erl_db.c')
-rw-r--r-- | erts/emulator/beam/erl_db.c | 15 |
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, |