diff options
author | Lukas Larsson <[email protected]> | 2011-09-29 18:02:47 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-09-29 18:02:47 +0200 |
commit | 09c46998b3a4b0060b3ff3799c142d564f91f517 (patch) | |
tree | 8f2f5f53b4efc4a0b19c3b668485f679a09f7e65 /erts/emulator/beam/erl_alloc.h | |
parent | 71099221fc8d0456fb38b1954e9053ec527d43b2 (diff) | |
parent | beaa58d5724c4ae45a716accdeee58961a27e1d9 (diff) | |
download | otp-09c46998b3a4b0060b3ff3799c142d564f91f517.tar.gz otp-09c46998b3a4b0060b3ff3799c142d564f91f517.tar.bz2 otp-09c46998b3a4b0060b3ff3799c142d564f91f517.zip |
Merge branch 'dev' into major
* dev:
Prevent valgrind warning for erts_alloc_permanent_cache_aligned
[erts] Fix memory leak in erts_make_stub_module (hipe loading)
Diffstat (limited to 'erts/emulator/beam/erl_alloc.h')
-rw-r--r-- | erts/emulator/beam/erl_alloc.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/erts/emulator/beam/erl_alloc.h b/erts/emulator/beam/erl_alloc.h index c35a60da22..80cb82c393 100644 --- a/erts/emulator/beam/erl_alloc.h +++ b/erts/emulator/beam/erl_alloc.h @@ -180,11 +180,11 @@ void *erts_realloc(ErtsAlcType_t type, void *ptr, Uint size); void erts_free(ErtsAlcType_t type, void *ptr); void *erts_alloc_fnf(ErtsAlcType_t type, Uint size); void *erts_realloc_fnf(ErtsAlcType_t type, void *ptr, Uint size); -void *erts_alloc_permanent_cache_aligned(ErtsAlcType_t type, Uint size); - #endif /* #if !ERTS_ALC_DO_INLINE */ +void *erts_alloc_permanent_cache_aligned(ErtsAlcType_t type, Uint size); + #ifndef ERTS_CACHE_LINE_SIZE /* Assume a cache line size of 64 bytes */ # define ERTS_CACHE_LINE_SIZE ((UWord) 64) @@ -250,18 +250,6 @@ void *erts_realloc_fnf(ErtsAlcType_t type, void *ptr, Uint size) size); } -ERTS_ALC_INLINE -void *erts_alloc_permanent_cache_aligned(ErtsAlcType_t type, Uint size) -{ - UWord v = (UWord) erts_alloc(type, size + (ERTS_CACHE_LINE_SIZE-1)); - - if (v & ERTS_CACHE_LINE_MASK) { - v = (v & ~ERTS_CACHE_LINE_MASK) + ERTS_CACHE_LINE_SIZE; - } - ASSERT((v & ERTS_CACHE_LINE_MASK) == 0); - return (void*)v; -} - #endif /* #if ERTS_ALC_DO_INLINE || defined(ERTS_ALC_INTERNAL__) */ typedef void (*erts_alloc_verify_func_t)(Allctr_t *); |