From 48e662a63e80c4f358be1ba062615ff56e09f331 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 23 Jan 2012 16:46:53 +0100 Subject: erts: Refactor new function index_put_entry() Same as index_put() but returns pointer to entry instead of index integer. --- erts/emulator/beam/index.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'erts/emulator/beam/index.h') diff --git a/erts/emulator/beam/index.h b/erts/emulator/beam/index.h index 69d1cc0a22..3afe48d007 100644 --- a/erts/emulator/beam/index.h +++ b/erts/emulator/beam/index.h @@ -55,16 +55,24 @@ void index_info(int, void *, IndexTable*); int index_table_sz(IndexTable *); int index_get(IndexTable*, void*); -int index_put(IndexTable*, void*); + +IndexSlot* index_put_entry(IndexTable*, void*); void erts_index_merge(Hash*, IndexTable*); /* Erase all entries with index 'ix' and higher */ void index_erase_latest_from(IndexTable*, Uint ix); +ERTS_GLB_INLINE int index_put(IndexTable*, void*); ERTS_GLB_INLINE IndexSlot* erts_index_lookup(IndexTable*, Uint); #if ERTS_GLB_INLINE_INCL_FUNC_DEF + +ERTS_GLB_INLINE int index_put(IndexTable* t, void* tmpl) +{ + return index_put_entry(t, tmpl)->index; +} + ERTS_GLB_INLINE IndexSlot* erts_index_lookup(IndexTable* t, Uint ix) { -- cgit v1.2.3