runtime: add exportedFuncPtr

This function isn't used yet, but will be used for the "cores" scheduler
for RISC-V.
This commit is contained in:
Ayke van Laethem
2025-06-10 18:44:32 +02:00
committed by Ron Evans
parent 525c41bac9
commit 64a30424da
2 changed files with 20 additions and 9 deletions
+5
View File
@@ -63,6 +63,11 @@ func strlen(ptr unsafe.Pointer) uintptr
//export malloc
func malloc(size uintptr) unsafe.Pointer
// Return the address of an exported function.
// This is mainly useful to pass a function pointer without extra context
// parameter to C, for example.
func exportedFuncPtr(fn func()) uintptr
// Compare two same-size buffers for equality.
func memequal(x, y unsafe.Pointer, n uintptr) bool {
for i := uintptr(0); i < n; i++ {