Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9fdce342
Commit
9fdce342
authored
Sep 09, 2010
by
Simon Marlow
Browse files
newAlignedPinnedByteArray#: avoid allocating an extra word sometimes
parent
907fa8af
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/PrimOps.cmm
View file @
9fdce342
...
...
@@ -109,6 +109,11 @@ stg_newAlignedPinnedByteArrayzh
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 */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment