aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-12-10 17:47:37 +0100
committerSverker Eriksson <[email protected]>2015-12-15 12:08:02 +0100
commit0f32d250876e7bb226fb96e07fb31734ba7d16f2 (patch)
treea38b1ea63152c5163b39605efe9154403eae03ea
parent5801defc866e34c6effd49b9dec995b5dac164f3 (diff)
downloadotp-0f32d250876e7bb226fb96e07fb31734ba7d16f2.tar.gz
otp-0f32d250876e7bb226fb96e07fb31734ba7d16f2.tar.bz2
otp-0f32d250876e7bb226fb96e07fb31734ba7d16f2.zip
erts: Rename proc dict size to arraySize
for naming style consistency.
-rw-r--r--erts/emulator/beam/erl_process_dict.c26
-rw-r--r--erts/emulator/beam/erl_process_dict.h2
2 files changed, 14 insertions, 14 deletions
diff --git a/erts/emulator/beam/erl_process_dict.c b/erts/emulator/beam/erl_process_dict.c
index b3d7627f08..e384f4c3f6 100644
--- a/erts/emulator/beam/erl_process_dict.c
+++ b/erts/emulator/beam/erl_process_dict.c
@@ -77,9 +77,9 @@
#define TCDR(Term) CDR(list_val(Term))
/* Array access macro */
-#define ARRAY_GET(PDict, Index) (ASSERT((Index) < (PDict)->size), \
+#define ARRAY_GET(PDict, Index) (ASSERT((Index) < (PDict)->arraySize), \
(PDict)->data[Index])
-#define ARRAY_PUT(PDict, Index, Val) (ASSERT((Index) < (PDict)->size), \
+#define ARRAY_PUT(PDict, Index, Val) (ASSERT((Index) < (PDict)->arraySize), \
(PDict)->data[Index] = (Val))
#define IS_POW2(X) ((X) && !((X) & ((X)-1)))
@@ -221,7 +221,7 @@ erts_dicts_mem_size(Process *p)
{
Uint size = 0;
if (p->dictionary)
- size += PD_SZ2BYTES(p->dictionary->size);
+ size += PD_SZ2BYTES(p->dictionary->arraySize);
return size;
}
@@ -800,7 +800,7 @@ static void shrink(Process *p, Eterm* ret)
--pd->usedSlots;
ARRAY_PUT(pd, pd->usedSlots, NIL);
}
- if (HASH_RANGE(p->dictionary) <= (p->dictionary->size / 4)) {
+ if (HASH_RANGE(p->dictionary) <= (p->dictionary->arraySize / 4)) {
array_shrink(&(p->dictionary), (HASH_RANGE(p->dictionary) * 3) / 2);
}
}
@@ -918,16 +918,16 @@ static void array_shrink(ProcDict **ppd, unsigned int need)
unsigned int siz = next_array_size(need);
HDEBUGF(("array_shrink: size = %d, need = %d",
- (*ppd)->size, need));
+ (*ppd)->arraySize, need));
- if (siz >= (*ppd)->size)
+ if (siz >= (*ppd)->arraySize)
return; /* Only shrink */
*ppd = PD_REALLOC(((void *) *ppd),
- PD_SZ2BYTES((*ppd)->size),
+ PD_SZ2BYTES((*ppd)->arraySize),
PD_SZ2BYTES(siz));
- (*ppd)->size = siz;
+ (*ppd)->arraySize = siz;
}
@@ -942,17 +942,17 @@ static void ensure_array_size(ProcDict **ppdict, unsigned int size)
pd = PD_ALLOC(PD_SZ2BYTES(siz));
for (i = 0; i < siz; ++i)
pd->data[i] = NIL;
- pd->size = siz;
+ pd->arraySize = siz;
*ppdict = pd;
- } else if (size > pd->size) {
- Uint osize = pd->size;
+ } else if (size > pd->arraySize) {
+ Uint osize = pd->arraySize;
Uint nsize = next_array_size(size);
pd = PD_REALLOC(((void *) pd),
PD_SZ2BYTES(osize),
PD_SZ2BYTES(nsize));
for (i = osize; i < nsize; ++i)
pd->data[i] = NIL;
- pd->size = nsize;
+ pd->arraySize = nsize;
*ppdict = pd;
}
}
@@ -1040,7 +1040,7 @@ static void pd_check(ProcDict *pd)
if (pd == NULL)
return;
used = HASH_RANGE(pd);
- ASSERT(pd->size >= used);
+ ASSERT(pd->arraySize >= used);
ASSERT(HASH_RANGE(pd) <= MAX_HASH);
for (i = 0, num = 0; i < used; ++i) {
Eterm t = pd->data[i];
diff --git a/erts/emulator/beam/erl_process_dict.h b/erts/emulator/beam/erl_process_dict.h
index f0d57da1e6..dac214c8a1 100644
--- a/erts/emulator/beam/erl_process_dict.h
+++ b/erts/emulator/beam/erl_process_dict.h
@@ -24,8 +24,8 @@
typedef struct proc_dict {
unsigned int sizeMask;
- unsigned int size;
unsigned int usedSlots;
+ unsigned int arraySize;
unsigned int splitPosition;
Uint numElements;
Eterm data[1]; /* The beginning of an array of erlang terms */