diff options
author | Rickard Green <[email protected]> | 2011-02-25 12:26:47 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-02-25 12:26:47 +0100 |
commit | 36fedbaec633e6afbe35877a688ac1a95516cdd4 (patch) | |
tree | 958dc7954e6776e385b0c6dd6f19a23dcd06b0de /erts/emulator/beam/erl_alloc.c | |
parent | f36365ab30f9e2811e8d9e2fc342bb1f4eac45ed (diff) | |
parent | 96effb9c1115f7a168d4db625726c738240d4c9b (diff) | |
download | otp-36fedbaec633e6afbe35877a688ac1a95516cdd4.tar.gz otp-36fedbaec633e6afbe35877a688ac1a95516cdd4.tar.bz2 otp-36fedbaec633e6afbe35877a688ac1a95516cdd4.zip |
Merge branch 'rickard/temp_alloc_check/OTP-9028' into dev
* rickard/temp_alloc_check/OTP-9028:
Verify that temp allocated memory is released
Diffstat (limited to 'erts/emulator/beam/erl_alloc.c')
-rw-r--r-- | erts/emulator/beam/erl_alloc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_alloc.c b/erts/emulator/beam/erl_alloc.c index e85e2d7e3f..323c422c6d 100644 --- a/erts/emulator/beam/erl_alloc.c +++ b/erts/emulator/beam/erl_alloc.c @@ -1411,6 +1411,33 @@ void erts_alloc_reg_scheduler_id(Uint id) erts_tsd_set(thr_ix_key, (void *)(long) ix); } +static void +no_verify(Allctr_t *allctr) +{ + +} + +erts_alloc_verify_func_t +erts_alloc_get_verify_unused_temp_alloc(Allctr_t **allctr) +{ + if (erts_allctrs_info[ERTS_ALC_A_TEMPORARY].alloc_util + && erts_allctrs_info[ERTS_ALC_A_TEMPORARY].thr_spec) { + ErtsAllocatorThrSpec_t *tspec; + tspec = &erts_allctr_thr_spec[ERTS_ALC_A_TEMPORARY]; + if (!tspec->all_thr_safe) { + int ix = erts_alc_get_thr_ix(); + + if (ix < tspec->size) { + *allctr = tspec->allctr[ix]; + return erts_alcu_verify_unused; + } + } + } + + *allctr = NULL; + return no_verify; +} + __decl_noreturn void erts_alc_fatal_error(int error, int func, ErtsAlcType_t n, ...) { |