aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-10-07 08:50:17 +0200
committerSverker Eriksson <[email protected]>2011-10-07 08:57:14 +0200
commitf5d785c6acabb647f6cd0319810511769bf05221 (patch)
treed4efc9e396893bb391b89618b396d23229c1cb2b /erts/emulator/beam
parentb3e5dc8edf45dca5ffcabe5a89380b3a4947a955 (diff)
downloadotp-f5d785c6acabb647f6cd0319810511769bf05221.tar.gz
otp-f5d785c6acabb647f6cd0319810511769bf05221.tar.bz2
otp-f5d785c6acabb647f6cd0319810511769bf05221.zip
erts: Remove valgrind limit for erts_alloc_permanent_cache_aligned
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/erl_alloc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c
index 9af80dd7a9..bce85a40f9 100644
--- a/erts/emulator/beam/erl_alloc.c
+++ b/erts/emulator/beam/erl_alloc.c
@@ -2962,16 +2962,18 @@ erts_allocator_options(void *proc)
void *erts_alloc_permanent_cache_aligned(ErtsAlcType_t type, Uint size)
{
- UWord v = (UWord) erts_alloc(type, size + (ERTS_CACHE_LINE_SIZE-1));
+ UWord v = (UWord) erts_alloc(type, size + (ERTS_CACHE_LINE_SIZE-1)
+#ifdef VALGRIND
+ + sizeof(UWord)
+#endif
+ );
#ifdef VALGRIND
- { /* Avoid Leak_PossiblyLost */
- static UWord vg_root_set[10];
- static unsigned ix = 0;
- if (ix >= sizeof(vg_root_set) / sizeof(*vg_root_set)) {
- erl_exit(ERTS_ABORT_EXIT, "Too many erts_alloc_permanent_cache_aligned's\n");
- }
- vg_root_set[ix++] = v; /* not thread safe */
+ { /* Link them to avoid Leak_PossiblyLost */
+ static UWord* first_in_list = NULL;
+ *(UWord**)v = first_in_list;
+ first_in_list = (UWord*) v;
+ v += sizeof(UWord);
}
#endif