[project @ 2003-02-12 23:38:23 by wolfgang]
authorwolfgang <unknown>
Wed, 12 Feb 2003 23:38:23 +0000 (23:38 +0000)
committerwolfgang <unknown>
Wed, 12 Feb 2003 23:38:23 +0000 (23:38 +0000)
Threaded RTS: improve ccall performance by allocation parameters as a
variable length array instead of using malloc

ghc/rts/Interpreter.c

index 79b883b..0df0f99 100644 (file)
@@ -1164,9 +1164,8 @@ run_BCO:
            // 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
                
@@ -1213,7 +1212,6 @@ run_BCO:
            // 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;