aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/crash_cgo_test.go
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2017-10-30 20:00:54 +1100
committerAlex Brainman <alex.brainman@gmail.com>2017-11-03 00:09:40 +0000
commit923299a6b85d22160dfdacca18f24ac6517ec1de (patch)
treefd38fa45260380815f69dd9833cc729b91a9bc25 /src/runtime/crash_cgo_test.go
parent25159d3af98335cfe574c66224a8c31df25ecc15 (diff)
downloadgo-923299a6b85d22160dfdacca18f24ac6517ec1de.tar.gz
go-923299a6b85d22160dfdacca18f24ac6517ec1de.zip
cmd/link: restore windows stack commit size back to 4KB
CL 49331 increased windows stack commit size to 2MB by mistake. Revert that change. Fixes #22439 Change-Id: I919e549e87da326f4ba45890b4d32f6d7046186f Reviewed-on: https://go-review.googlesource.com/74490 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/crash_cgo_test.go')
-rw-r--r--src/runtime/crash_cgo_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go
index cad2b2ac22..434dd58ac3 100644
--- a/src/runtime/crash_cgo_test.go
+++ b/src/runtime/crash_cgo_test.go
@@ -13,6 +13,7 @@ import (
"os"
"os/exec"
"runtime"
+ "strconv"
"strings"
"testing"
"time"
@@ -452,3 +453,20 @@ func TestCgoLockOSThreadExit(t *testing.T) {
t.Parallel()
testLockOSThreadExit(t, "testprogcgo")
}
+
+func testWindowsStackMemory(t *testing.T, o string) {
+ stackUsage, err := strconv.Atoi(o)
+ if err != nil {
+ t.Fatalf("Failed to read stack usage: %v", err)
+ }
+ if expected, got := 100<<10, stackUsage; got > expected {
+ t.Fatalf("expected < %d bytes of memory per thread, got %d", expected, got)
+ }
+}
+
+func TestWindowsStackMemoryCgo(t *testing.T) {
+ if runtime.GOOS != "windows" {
+ t.Skip("skipping windows specific test")
+ }
+ testWindowsStackMemory(t, runTestProg(t, "testprogcgo", "StackMemory"))
+}