diff options
author | Sverker Eriksson <[email protected]> | 2012-01-23 16:46:53 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-02-21 12:23:01 +0100 |
commit | 48e662a63e80c4f358be1ba062615ff56e09f331 (patch) | |
tree | a253cb707b95528e46137654e667426ea223e465 /erts/emulator/beam/index.c | |
parent | 194ae0717f9be27374db3609e6884fad086df4df (diff) | |
download | otp-48e662a63e80c4f358be1ba062615ff56e09f331.tar.gz otp-48e662a63e80c4f358be1ba062615ff56e09f331.tar.bz2 otp-48e662a63e80c4f358be1ba062615ff56e09f331.zip |
erts: Refactor new function index_put_entry()
Same as index_put() but returns pointer to entry instead of index integer.
Diffstat (limited to 'erts/emulator/beam/index.c')
-rw-r--r-- | erts/emulator/beam/index.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/index.c b/erts/emulator/beam/index.c index 7cd45440f4..25d5cce0f3 100644 --- a/erts/emulator/beam/index.c +++ b/erts/emulator/beam/index.c @@ -68,14 +68,14 @@ erts_index_init(ErtsAlcType_t type, IndexTable* t, char* name, return t; } -int -index_put(IndexTable* t, void* tmpl) +IndexSlot* +index_put_entry(IndexTable* t, void* tmpl) { int ix; IndexSlot* p = (IndexSlot*) hash_put(&t->htable, tmpl); if (p->index >= 0) { - return p->index; + return p; } ix = t->entries; @@ -92,7 +92,7 @@ index_put(IndexTable* t, void* tmpl) t->entries++; p->index = ix; t->seg_table[ix>>INDEX_PAGE_SHIFT][ix&INDEX_PAGE_MASK] = p; - return ix; + return p; } int index_get(IndexTable* t, void* tmpl) |