From c9e0d53dc93d11e89198e1d542df397272eb7d2c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 14 Aug 2024 20:02:56 +0200 Subject: [PATCH] memsize: panic on Go 1.23 --- runtimefunc_go121.go | 4 ++-- runtimefunc_go123.go | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 runtimefunc_go123.go diff --git a/runtimefunc_go121.go b/runtimefunc_go121.go index 17ea979..12b9286 100644 --- a/runtimefunc_go121.go +++ b/runtimefunc_go121.go @@ -1,5 +1,5 @@ -//go:build go1.21 -// +build go1.21 +//go:build go1.21 && !go1.23 +// +build go1.21,!go1.23 package memsize diff --git a/runtimefunc_go123.go b/runtimefunc_go123.go new file mode 100644 index 0000000..fd1ca8f --- /dev/null +++ b/runtimefunc_go123.go @@ -0,0 +1,12 @@ +//go:build go1.23 +// +build go1.23 + +package memsize + +type stwReason uint8 + +const stwReadMemStats stwReason = 7 + +func stopTheWorld(reason stwReason) { + panic("memsize is not supported with Go >= 1.23") +}