]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix plan9/windows build
authorDmitriy Vyukov <dvyukov@google.com>
Thu, 7 Aug 2014 09:28:10 +0000 (13:28 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Thu, 7 Aug 2014 09:28:10 +0000 (13:28 +0400)
Fix few remaining cases after cl/117580043.

TBR=dfc
R=golang-codereviews
CC=dave, golang-codereviews
https://golang.org/cl/124850043

src/pkg/runtime/callback_windows.c
src/pkg/runtime/env_plan9.c
src/pkg/runtime/os_plan9.c
src/pkg/runtime/os_windows.c

index 285678fbac243f8eb79ccf8ea1ecebfe183fc586..97b75e1d2c3efa468b0d5ce584746414d7b8fdfe 100644 (file)
@@ -60,7 +60,7 @@ runtime·compilecallback(Eface fn, bool cleanstack)
        }
        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;
index f732c9f294ee3d22545a3d2bd98d3a0cdca672d8..b6e98514f3c9394bebd894938047f5c02361078a 100644 (file)
@@ -33,7 +33,7 @@ runtime·getenv(int8 *s)
                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)
index 02723fd9e45daab0db3d62d17173596dfc9aeeaf..98e449251a5407ad2a01e4d019d44e28ac9cf22b 100644 (file)
@@ -20,11 +20,11 @@ runtime·mpreinit(M *mp)
        // 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).
index 1dc0780ba9ba9ea21f0217c36045e9c73bf913fd..79dc2960f99acd3357088a722eb5a816edc904a9 100644 (file)
@@ -143,7 +143,7 @@ runtime·goenvs(void)
        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++) {