summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/mheap.c3
-rw-r--r--libgo/runtime/proc.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/libgo/runtime/mheap.c b/libgo/runtime/mheap.c
index 1b6cfd3dcde..62070f37943 100644
--- a/libgo/runtime/mheap.c
+++ b/libgo/runtime/mheap.c
@@ -68,6 +68,7 @@ runtime_MHeap_Init(MHeap *h)
void
runtime_MHeap_MapSpans(MHeap *h)
{
+ uintptr pagesize;
uintptr n;
// Map spans array, PageSize at a time.
@@ -76,6 +77,8 @@ runtime_MHeap_MapSpans(MHeap *h)
n -= (uintptr)h->arena_start;
n = n / PageSize * sizeof(h->spans[0]);
n = ROUND(n, PageSize);
+ pagesize = getpagesize();
+ n = ROUND(n, pagesize);
if(h->spans_mapped >= n)
return;
runtime_SysMap((byte*)h->spans + h->spans_mapped, n - h->spans_mapped, &mstats.other_sys);
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c
index ab7cde43863..7011f14f8a5 100644
--- a/libgo/runtime/proc.c
+++ b/libgo/runtime/proc.c
@@ -2098,7 +2098,7 @@ runtime_malg(int32 stacksize, byte** ret_stack, size_t* ret_stacksize)
__splitstack_block_signals_context(&newg->stack_context[0],
&dont_block_signals, nil);
#else
- *ret_stack = runtime_mallocgc(stacksize, FlagNoProfiling|FlagNoGC, 0, 0);
+ *ret_stack = runtime_mallocgc(stacksize, 0, FlagNoProfiling|FlagNoGC);
*ret_stacksize = stacksize;
newg->gcinitial_sp = *ret_stack;
newg->gcstack_size = stacksize;