Threaded RTS: improve ccall performance by allocation parameters as a
variable length array instead of using malloc
// collection might move the TSO as soon as we call
// suspendThread below.
- void *arguments;
+ W_ arguments[stk_offset];
- arguments = stgMallocWords(stk_offset,"bci_CCALL");
memcpy(arguments, Sp, sizeof(W_) * stk_offset);
#endif
// back to the TSO stack. It would of course be enough to
// just copy the return value, but we don't know the offset.
memcpy(Sp, arguments, sizeof(W_) * stk_offset);
- free(arguments);
#endif
goto nextInsn;