Use malloc to allocate storage for task parameters on Windows.

Fixes bug #55.  A number of tests were crashing on Windows due to the task
launch code using alloca to allocate space for the tasks' parameters.  On
Windows, the stack isn't generally big enough for this to be a good idea.
Also added an alignment parmaeter to ISPCMalloc() to pass the alignment
requirement along.
This commit is contained in:
Matt Pharr
2011-07-06 05:53:25 -07:00
parent 4d733af3c7
commit 6e4c165c7e
8 changed files with 80 additions and 14 deletions

2
ctx.h
View File

@@ -213,7 +213,7 @@ public:
/** Emit code to call the user-supplied ISPCMalloc function to
allocate space for an object of thee given type. Returns the
pointer value returned by the ISPCMalloc call. */
llvm::Value *EmitMalloc(const llvm::Type *ty);
llvm::Value *EmitMalloc(const llvm::Type *ty, int align = 0);
/** Emit code to call the user-supplied ISPCFree function, passing it
the given pointer to storage previously allocated by an