Commit 5290e551 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

runtime: use persistentalloc instead of SysAlloc in netpoll

Especially important for Windows because it reserves VM
only in multiple of 64k.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/10138043
parent 8cf70449
...@@ -338,7 +338,7 @@ allocPollDesc(void) ...@@ -338,7 +338,7 @@ allocPollDesc(void)
n = 1; n = 1;
// Must be in non-GC memory because can be referenced // Must be in non-GC memory because can be referenced
// only from epoll/kqueue internals. // only from epoll/kqueue internals.
pd = runtime·SysAlloc(n*sizeof(*pd)); pd = runtime·persistentalloc(n*sizeof(*pd), 0);
for(i = 0; i < n; i++) { for(i = 0; i < n; i++) {
pd[i].link = pollcache.first; pd[i].link = pollcache.first;
pollcache.first = &pd[i]; pollcache.first = &pd[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment