X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FPrimOps.cmm;h=1cc9544e068128c37ae418fc8a2d1eb85b7ddc00;hb=d108044bef62f6a0d579c92ced5e8188f72edc2d;hp=029b2b751a84b6de2a256a98dda77057dde9eb3e;hpb=17c8229adf9f268097e4c87053d940a918c3a26f;p=ghc-hetmet.git diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 029b2b7..1cc9544 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -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 */ @@ -2020,6 +2025,17 @@ stg_getSparkzh #endif } +stg_numSparkszh +{ + W_ n; +#ifdef THREADED_RTS + (n) = foreign "C" dequeElements(Capability_sparks(MyCapability())); +#else + n = 0; +#endif + RET_N(n); +} + stg_traceEventzh { W_ msg;