From aac03c5e9ccf9f6066e291a7c87dd58c1181c227 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Thu, 19 Jan 2012 12:10:20 +0100 Subject: erts: Multiple module tables using code_ix --- erts/emulator/beam/index.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'erts/emulator/beam/index.c') diff --git a/erts/emulator/beam/index.c b/erts/emulator/beam/index.c index a4a3007f93..7cd45440f4 100644 --- a/erts/emulator/beam/index.c +++ b/erts/emulator/beam/index.c @@ -135,3 +135,18 @@ void erts_index_merge(Hash* src, IndexTable* dst) } } } + +void index_erase_latest_from(IndexTable* t, Uint from_ix) +{ + if(from_ix < (Uint)t->entries) { + int ix; + for (ix = from_ix; ix < t->entries; ix++) { + IndexSlot* obj = t->seg_table[ix>>INDEX_PAGE_SHIFT][ix&INDEX_PAGE_MASK]; + hash_erase(&t->htable, obj); + } + t->entries = from_ix; + } + else { + ASSERT(from_ix == t->entries); + } +} -- cgit v1.2.3