OSDN Git Service

Update Go compiler, library, and testsuite on gcc 4.7 branch.
[pf3gnuchains/gcc-fork.git] / libgo / runtime / chan.c
index 24be950..db91d2c 100644 (file)
@@ -662,6 +662,10 @@ newselect(int32 size, Select **selp)
        if(size > 1)
                n = size-1;
 
+       // allocate all the memory we need in a single allocation
+       // start with Select with size cases
+       // then lockorder with size entries
+       // then pollorder with size entries
        sel = runtime_mal(sizeof(*sel) +
                n*sizeof(sel->scase[0]) +
                size*sizeof(sel->lockorder[0]) +