}
if(n >= cb_max)
runtime·throw("too many callback functions");
- c = runtime·mal(sizeof *c);
+ c = runtime·mallocgc(sizeof *c, nil, 0);
c->gobody = fn.data;
c->argsize = argsize;
c->cleanstack = cleanstack;
runtime·memclr(b, sizeof b);
p = b;
}else
- p = runtime·malloc(n+1);
+ p = runtime·mallocgc(n+1, nil, 0);
r = runtime·pread(fd, p, n, 0);
runtime·close(fd);
if(r < 0)
// Initialize stack and goroutine for note handling.
mp->gsignal = runtime·malg(32*1024);
mp->gsignal->m = mp;
- mp->notesig = (int8*)runtime·malloc(ERRMAX*sizeof(int8));
+ mp->notesig = (int8*)runtime·mallocgc(ERRMAX*sizeof(int8), nil, 0);
// Initialize stack for handling strings from the
// errstr system call, as used in package syscall.
- mp->errstr = (byte*)runtime·malloc(ERRMAX*sizeof(byte));
+ mp->errstr = (byte*)runtime·mallocgc(ERRMAX*sizeof(byte), nil, 0);
}
// Called to initialize a new m (including the bootstrap m).
for(p=env; *p; n++)
p += runtime·findnullw(p)+1;
- s = runtime·malloc(n*sizeof s[0]);
+ s = runtime·mallocgc(n*sizeof s[0], nil, 0);
p = env;
for(i=0; i<n; i++) {