Browse Source

move hobject hash probe defines to the header

pull/1/head
Sami Vaarala 12 years ago
parent
commit
df07f2f810
  1. 4
      src/duk_hobject.h
  2. 4
      src/duk_hobject_props.c

4
src/duk_hobject.h

@ -369,6 +369,10 @@
#define DUK_HOBJECT_A_MIN_GROW_ADD 16 #define DUK_HOBJECT_A_MIN_GROW_ADD 16
#define DUK_HOBJECT_A_MIN_GROW_DIVISOR 8 /* 2^3 -> 1/8 = 12.5% min growth */ #define DUK_HOBJECT_A_MIN_GROW_DIVISOR 8 /* 2^3 -> 1/8 = 12.5% min growth */
/* probe sequence */
#define DUK_HOBJECT_HASH_INITIAL(hash,h_size) ((hash) % (h_size))
#define DUK_HOBJECT_HASH_PROBE_STEP(hash) DUK_UTIL_GET_HASH_PROBE_STEP((hash))
/* /*
* PC-to-line constants * PC-to-line constants
*/ */

4
src/duk_hobject_props.c

@ -48,8 +48,8 @@
#define NO_ARRAY_INDEX DUK_HSTRING_NO_ARRAY_INDEX #define NO_ARRAY_INDEX DUK_HSTRING_NO_ARRAY_INDEX
/* hash probe sequence */ /* hash probe sequence */
#define HASH_INITIAL(hash,h_size) ((hash) % (h_size)) #define HASH_INITIAL(hash,h_size) DUK_HOBJECT_HASH_INITIAL((hash),(h_size))
#define HASH_PROBE_STEP(hash) DUK_UTIL_GET_HASH_PROBE_STEP((hash)) #define HASH_PROBE_STEP(hash) DUK_HOBJECT_HASH_PROBE_STEP((hash))
/* marker values for hash part */ /* marker values for hash part */
#define HASH_UNUSED DUK_HOBJECT_HASHIDX_UNUSED #define HASH_UNUSED DUK_HOBJECT_HASHIDX_UNUSED

Loading…
Cancel
Save