mirror of
https://github.com/golang/go
synced 2024-11-23 05:00:07 -07:00
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
This commit is contained in:
parent
8cf7044983
commit
5290e55164
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user