@@ -0,0 +1,15 @@
+// +build baremetal
+
+package runtime
+
+import "unsafe"
+
+//go:export malloc
+func libc_malloc(size uintptr) unsafe.Pointer {
+	return alloc(size)
+}
+
+//go:export free
+func libc_free(ptr unsafe.Pointer) {
+	free(ptr)
+}
The typical Go version is `//export`, not `//go:export`. TinyGo treats those identically, but I think it's best to move to `//export` everywhere (and not introduce new `//go:export` pragmas) to be consistent with the wider Go ecosystem. The same goes for `libc_free` below.