diff options
author | Micael Karlberg <[email protected]> | 2011-02-28 19:07:16 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-02-28 19:07:16 +0100 |
commit | 7c1117fd0e509115fb17a1a101233f19be555991 (patch) | |
tree | f0eeb2636a879bf37120b7b976ddf3979be8890d /erts/emulator/beam/erl_process.h | |
parent | 2c13b770cf24be58db1862afc38143d889ac2600 (diff) | |
parent | 98d3b0c86ff3d99a4d175291df54c5ed48357fce (diff) | |
download | otp-7c1117fd0e509115fb17a1a101233f19be555991.tar.gz otp-7c1117fd0e509115fb17a1a101233f19be555991.tar.bz2 otp-7c1117fd0e509115fb17a1a101233f19be555991.zip |
Merge branch 'dev' into bmk/snmp/snmp419_integration/OTP-9068
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r-- | erts/emulator/beam/erl_process.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index 8479e56710..e871a9834a 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -28,6 +28,12 @@ #define ERTS_INCLUDE_SCHEDULER_INTERNALS #endif +/* #define ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC */ + +#if !defined(ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC) && defined(DEBUG) +# define ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC +#endif + typedef struct process Process; #include "sys.h" @@ -421,6 +427,11 @@ struct ErtsSchedulerData_ { /* NOTE: These fields are modified under held mutexes by other threads */ erts_smp_atomic32_t chk_cpu_bind; /* Only used when common run queue */ #endif + +#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC + erts_alloc_verify_func_t verify_unused_temp_alloc; + Allctr_t *verify_unused_temp_alloc_data; +#endif }; typedef union { @@ -1145,6 +1156,20 @@ Uint erts_debug_nbalance(void); # define ERTS_PROC_GET_SCHDATA(PROC) (erts_scheduler_data) #endif +#ifdef ERTS_DO_VERIFY_UNUSED_TEMP_ALLOC +# define ERTS_VERIFY_UNUSED_TEMP_ALLOC(P) \ +do { \ + ErtsSchedulerData *esdp__ = ((P) \ + ? ERTS_PROC_GET_SCHDATA((Process *) (P)) \ + : erts_get_scheduler_data()); \ + if (esdp__) \ + esdp__->verify_unused_temp_alloc( \ + esdp__->verify_unused_temp_alloc_data); \ +} while (0) +#else +# define ERTS_VERIFY_UNUSED_TEMP_ALLOC(ESDP) +#endif + #if defined(ERTS_SMP) || defined(USE_THREADS) ErtsSchedulerData *erts_get_scheduler_data(void); #else |