projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
907fa8a
)
newAlignedPinnedByteArray#: avoid allocating an extra word sometimes
author
Simon Marlow
<marlowsd@gmail.com>
Thu, 9 Sep 2010 11:08:05 +0000
(11:08 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Thu, 9 Sep 2010 11:08:05 +0000
(11:08 +0000)
rts/PrimOps.cmm
patch
|
blob
|
history
diff --git
a/rts/PrimOps.cmm
b/rts/PrimOps.cmm
index
3c7dbdd
..
1cc9544
100644
(file)
--- a/
rts/PrimOps.cmm
+++ b/
rts/PrimOps.cmm
@@
-109,6
+109,11
@@
stg_newAlignedPinnedByteArrayzh
n = R1;
alignment = R2;
n = R1;
alignment = R2;
+ /* we always supply at least word-aligned memory, so there's no
+ need to allow extra space for alignment if the requirement is less
+ than a word. This also prevents mischief with alignment == 0. */
+ if (alignment <= SIZEOF_W) { alignment = 1; }
+
bytes = n;
/* payload_words is what we will tell the profiler we had to allocate */
bytes = n;
/* payload_words is what we will tell the profiler we had to allocate */