summaryrefslogtreecommitdiff
path: root/concurrency.c
diff options
context:
space:
mode:
Diffstat (limited to 'concurrency.c')
-rw-r--r--concurrency.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/concurrency.c b/concurrency.c
index 4af563c..c393884 100644
--- a/concurrency.c
+++ b/concurrency.c
@@ -4,7 +4,7 @@
#include <bio.h>
#include "apl9.h"
-#define STACKSIZE (8*1024*1024) /* 8 MB */
+#define STACKSIZE (8*1024*1024) /* 64 MB */
typedef struct SpawnData SpawnData;
struct SpawnData
@@ -48,7 +48,7 @@ spawnthread(Function f, Array *left, Array *right)
exit proc
*/
Channel *setupdone = chancreate(sizeof(int), 0);
- SpawnData *sp = malloc(sizeof(SpawnData));
+ SpawnData *sp = emalloc(sizeof(SpawnData));
sp->func = f;
sp->left = left ? duparray(left) : nil;
sp->right = duparray(right);
@@ -77,7 +77,7 @@ messagesend(Array *a, int id)
unlock(&threadlock);
if(td != nil){
qlock(&td->lock);
- Mail *newmail = malloc(sizeof(Mail));
+ Mail *newmail = emalloc(sizeof(Mail));
newmail->contents = fnSame(a);
newmail->next = 0;
if(td->lastmail != nil)
@@ -132,7 +132,7 @@ newprocfn(void *data)
static ThreadData *
newthreaddata(void)
{
- ThreadData *td = mallocz(sizeof(ThreadData), 1);
+ ThreadData *td = emallocz(sizeof(ThreadData), 1);
td->id = threadid();
td->currentdfn = nil;
td->mail = 0;
@@ -141,7 +141,7 @@ newthreaddata(void)
lock(&threadlock);
nthreads++;
- threads = realloc(threads, sizeof(ThreadData *) * nthreads);
+ threads = erealloc(threads, sizeof(ThreadData *) * nthreads);
threads[nthreads-1] = td;
unlock(&threadlock);
return td;