aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2012-04-30 16:53:05 +0200
committerBjörn-Egil Dahlberg <[email protected]>2012-04-30 16:53:05 +0200
commit9ba8ee3474fa342c1c5de0fcf7782d5d069a487e (patch)
treea0d0013fa0be1f7389c51a759da3360eb476ff5a /erts/emulator/beam/io.c
parent91a6dc5c75f23164a9b9100dbe96ebd2fee6860b (diff)
parent50176a20c64ccd98a5d534b3c388593ff654fc8e (diff)
downloadotp-9ba8ee3474fa342c1c5de0fcf7782d5d069a487e.tar.gz
otp-9ba8ee3474fa342c1c5de0fcf7782d5d069a487e.tar.bz2
otp-9ba8ee3474fa342c1c5de0fcf7782d5d069a487e.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 7b8bff24e8..845593d0b2 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -3282,6 +3282,8 @@ driver_deliver_term(ErlDrvPort port,
Uint size = ptr[1];
Uint offset = ptr[2];
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) size);
+
if (size <= ERL_ONHEAP_BIN_LIMIT) {
ErlHeapBin* hbp = (ErlHeapBin *) hp;
hp += heap_bin_size(size);
@@ -3313,6 +3315,9 @@ driver_deliver_term(ErlDrvPort port,
case ERL_DRV_BUF2BINARY: { /* char*, size */
byte *bufp = (byte *) ptr[0];
Uint size = (Uint) ptr[1];
+
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) size);
+
if (size <= ERL_ONHEAP_BIN_LIMIT) {
ErlHeapBin* hbp = (ErlHeapBin *) hp;
hp += heap_bin_size(size);
@@ -3349,6 +3354,7 @@ driver_deliver_term(ErlDrvPort port,
}
case ERL_DRV_STRING: /* char*, length */
+ erts_smp_atomic_add_nob(&erts_bytes_in, (erts_aint_t) ptr[1]);
mess = buf_to_intlist(&hp, (char*)ptr[0], ptr[1], NIL);
ptr += 2;
break;