From 221ea6a54c16a3131fdf429de9a94c2a58713aaf Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 25 May 2026 18:28:05 +0200 Subject: [PATCH] runtime: move alloc_noheap call (pure refactor) See the next commit, where this makes more sense. --- src/runtime/gc.go | 10 ++++++++++ src/runtime/runtime.go | 5 ----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 src/runtime/gc.go diff --git a/src/runtime/gc.go b/src/runtime/gc.go new file mode 100644 index 000000000..c8c1706e9 --- /dev/null +++ b/src/runtime/gc.go @@ -0,0 +1,10 @@ +package runtime + +// Shared code for the various garbage collectors. + +import "unsafe" + +// Special alloc function that should never actually be called. +// It is used instead of normal alloc in //go:noheap functions, and must either +// be optimized away or throw a linker error. +func alloc_noheap(size uintptr, layout unsafe.Pointer) unsafe.Pointer diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go index 872b225b9..c9b095938 100644 --- a/src/runtime/runtime.go +++ b/src/runtime/runtime.go @@ -66,11 +66,6 @@ func llvm_sponentry() unsafe.Pointer //export strlen func strlen(ptr unsafe.Pointer) uintptr -// Special alloc function that should never actually be called. -// It is used instead of normal alloc in //go:noheap functions, and must either -// be optimized away or throw a linker error. -func alloc_noheap(size uintptr, layout unsafe.Pointer) unsafe.Pointer - //export malloc func malloc(size uintptr) unsafe.Pointer