diff options
author | Rickard Green <rickard@erlang.org> | 2011-01-14 12:04:54 +0100 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2011-02-10 14:28:29 +0100 |
commit | 96effb9c1115f7a168d4db625726c738240d4c9b (patch) | |
tree | 31183f95883f043fa8a2a8e7391fd02b62ea3ead /erts/emulator/beam/erl_alloc.c | |
parent | c694c0be5656bda37fafdef858a82c76bdcf8f14 (diff) | |
download | otp-96effb9c1115f7a168d4db625726c738240d4c9b.tar.gz otp-96effb9c1115f7a168d4db625726c738240d4c9b.tar.bz2 otp-96effb9c1115f7a168d4db625726c738240d4c9b.zip |
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, ...) { |