aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-12-13 16:36:49 +0100
committerLukas Larsson <[email protected]>2018-12-13 16:39:20 +0100
commitbe749b4f83f3b3a2fa3bd8e5a3e5e28467b137b2 (patch)
treee00ec5dd304508a23159020eabd75bde9595986a /erts
parent0edd7ee4d575656f6da6558e40d6993f41a4be38 (diff)
downloadotp-be749b4f83f3b3a2fa3bd8e5a3e5e28467b137b2.tar.gz
otp-be749b4f83f3b3a2fa3bd8e5a3e5e28467b137b2.tar.bz2
otp-be749b4f83f3b3a2fa3bd8e5a3e5e28467b137b2.zip
erts: Use sys_memcpy in copy_one_frag
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_gc.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c
index a65dbbf42b..4a80c00416 100644
--- a/erts/emulator/beam/erl_gc.c
+++ b/erts/emulator/beam/erl_gc.c
@@ -2419,27 +2419,9 @@ erts_copy_one_frag(Eterm** hpp, ErlOffHeap* off_heap,
cpy_words:
ASSERT(sz >= cpy_sz);
sz -= cpy_sz;
- while (cpy_sz >= 8) {
- cpy_sz -= 8;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- *hp++ = *fhp++;
- }
- switch (cpy_sz) {
- case 7: *hp++ = *fhp++;
- case 6: *hp++ = *fhp++;
- case 5: *hp++ = *fhp++;
- case 4: *hp++ = *fhp++;
- case 3: *hp++ = *fhp++;
- case 2: *hp++ = *fhp++;
- case 1: *hp++ = *fhp++;
- default: break;
- }
+ sys_memcpy(hp, fhp, cpy_sz * sizeof(Eterm));
+ hp += cpy_sz;
+ fhp += cpy_sz;
if (oh) {
/* Add to offheap list */
oh->next = off_heap->first;