aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bif_load.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2012-01-26 16:25:26 +0100
committerSverker Eriksson <[email protected]>2012-02-21 12:23:04 +0100
commite60c9cd4356a91c10657b5de86af8279ccd6eb79 (patch)
tree0dfe3a276ce4a23571e97cbfbb15a94ced6fd77a /erts/emulator/beam/beam_bif_load.c
parent605c7c1bafc72b0cc3a6ee6110abf8676b6b287f (diff)
downloadotp-e60c9cd4356a91c10657b5de86af8279ccd6eb79.tar.gz
otp-e60c9cd4356a91c10657b5de86af8279ccd6eb79.tar.bz2
otp-e60c9cd4356a91c10657b5de86af8279ccd6eb79.zip
erts: Move number-of-breakpoint counter from code to Module struct
The is a refactoring in preparation to add a counter in Module struct for export entry tracing. It is nicer if the two are kept together.
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r--erts/emulator/beam/beam_bif_load.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index c14b86f811..4265f139df 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -826,8 +826,8 @@ static void ensure_no_breakpoints(Process *c_p, ErtsProcLocks c_p_locks,
ErtsCodeIndex code_ix = erts_active_code_ix();
Module* modp = erts_get_module(module, code_ix);
- if (modp && modp->curr.code != NULL
- && modp->curr.code[MI_NUM_BREAKPOINTS] > 0) {
+ if (modp && modp->curr.num_breakpoints > 0) {
+ ASSERT(modp->curr.code != NULL);
#ifdef ERTS_ENABLE_LOCK_CHECK
#ifdef ERTS_SMP
if (c_p && c_p_locks)
@@ -840,7 +840,7 @@ static void ensure_no_breakpoints(Process *c_p, ErtsProcLocks c_p_locks,
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCK_MAIN);
erts_smp_thr_progress_block();
erts_clear_module_break(modp);
- modp->curr.code[MI_NUM_BREAKPOINTS] = 0;
+ modp->curr.num_breakpoints = 0;
erts_smp_thr_progress_unblock();
if (c_p && c_p_locks)
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
@@ -854,7 +854,7 @@ static void ensure_no_breakpoints(Process *c_p, ErtsProcLocks c_p_locks,
static void
delete_code(Process *c_p, ErtsProcLocks c_p_locks, Module* modp)
{
- ASSERT(!(modp->curr.code && modp->curr.code[MI_NUM_BREAKPOINTS] > 0));
+ ASSERT(modp->curr.num_breakpoints == 0);
modp->old = modp->curr;
modp->curr.code = NULL;
modp->curr.code_length = 0;