aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-08-18 13:31:24 +0200
committerBjörn Gustavsson <[email protected]>2010-08-18 13:33:48 +0200
commit1f200bbf7c8dede1863d1de9ba584bec84c81aac (patch)
treed4a9f4332dbd6137c72db80003080c6331373e66
parent4961daa3b35822ae4221209f72767aabad113368 (diff)
parent6b8733b2b7e240bbda505b10e6e443f9278451b8 (diff)
downloadotp-1f200bbf7c8dede1863d1de9ba584bec84c81aac.tar.gz
otp-1f200bbf7c8dede1863d1de9ba584bec84c81aac.tar.bz2
otp-1f200bbf7c8dede1863d1de9ba584bec84c81aac.zip
Merge branch 'mp/fix-hipe_bifs_alloc_data' into dev
* mp/fix-hipe_bifs_alloc_data: fix hipe_bifs_alloc_data_2 to avoid "Yikes!" warning OTP-8769
-rw-r--r--erts/emulator/hipe/hipe_bif0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c
index b0abfd2310..2a877d8ace 100644
--- a/erts/emulator/hipe/hipe_bif0.c
+++ b/erts/emulator/hipe/hipe_bif0.c
@@ -440,9 +440,12 @@ BIF_RETTYPE hipe_bifs_alloc_data_2(BIF_ALIST_2)
align != sizeof(long) && align != sizeof(double)))
BIF_ERROR(BIF_P, BADARG);
nrbytes = unsigned_val(BIF_ARG_2);
+ if (nrbytes == 0)
+ BIF_RET(make_small(0));
block = erts_alloc(ERTS_ALC_T_HIPE, nrbytes);
if ((unsigned long)block & (align-1))
- fprintf(stderr, "Yikes! erts_alloc() returned misaligned address %p\r\n", block);
+ fprintf(stderr, "%s: erts_alloc(%lu) returned %p which is not %lu-byte aligned\r\n",
+ __FUNCTION__, (unsigned long)nrbytes, block, (unsigned long)align);
BIF_RET(address_to_term(block, BIF_P));
}