aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/external.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-02-09 17:21:28 +0100
committerBjörn Gustavsson <[email protected]>2010-03-10 14:25:21 +0100
commitc591f7b2a78b44ab321d0b99c100b349c8606c15 (patch)
tree492533e735efed799bb8ddd427594835bd41e142 /erts/emulator/beam/external.c
parent64415f09de0691c2ccdf65df169a211b7917728b (diff)
downloadotp-c591f7b2a78b44ab321d0b99c100b349c8606c15.tar.gz
otp-c591f7b2a78b44ab321d0b99c100b349c8606c15.tar.bz2
otp-c591f7b2a78b44ab321d0b99c100b349c8606c15.zip
Make tracing and distribution work
Rewrite trace code and external coding. Also slightly correct the interface to the match-spec engine to make tracing work. That will make the test suites runnable.
Diffstat (limited to 'erts/emulator/beam/external.c')
-rw-r--r--erts/emulator/beam/external.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index 7f39f8eb12..ac8dd27b15 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -2260,18 +2260,25 @@ dec_term_atom_common:
node = erts_find_or_insert_node(sysname, cre);
if(node == erts_this_node) {
RefThing *rtp = (RefThing *) hp;
- hp += REF_THING_HEAD_SIZE;
+ ref_num = (Uint32 *) (hp + REF_THING_HEAD_SIZE);
+
#if defined(ARCH_64) && !HALFWORD_HEAP
+ hp += REF_THING_HEAD_SIZE + ref_words/2 + 1;
rtp->header = make_ref_thing_header(ref_words/2 + 1);
#else
+ hp += REF_THING_HEAD_SIZE + ref_words;
rtp->header = make_ref_thing_header(ref_words);
#endif
*objp = make_internal_ref(rtp);
}
else {
ExternalThing *etp = (ExternalThing *) hp;
- hp += EXTERNAL_THING_HEAD_SIZE;
-
+#if defined(ARCH_64) && !HALFWORD_HEAP
+ hp += EXTERNAL_THING_HEAD_SIZE + ref_words/2 + 1;
+#else
+ hp += EXTERNAL_THING_HEAD_SIZE + ref_words;
+#endif
+
#if defined(ARCH_64) && !HALFWORD_HEAP
etp->header = make_external_ref_header(ref_words/2 + 1);
#else
@@ -2282,9 +2289,9 @@ dec_term_atom_common:
off_heap->externals = etp;
*objp = make_external_ref(etp);
+ ref_num = &(etp->data.ui32[0]);
}
- ref_num = (Uint32 *) hp;
#if defined(ARCH_64) && !HALFWORD_HEAP
*(ref_num++) = ref_words /* 32-bit arity */;
#endif
@@ -2296,9 +2303,6 @@ dec_term_atom_common:
#if defined(ARCH_64) && !HALFWORD_HEAP
if ((1 + ref_words) % 2)
ref_num[ref_words] = 0;
- hp += ref_words/2 + 1;
-#else
- hp += ref_words;
#endif
break;
}