🐛 fix native file sink lifecycle behavior

This commit is contained in:
Nanaloveyuki
2026-06-14 12:55:29 +08:00
parent 159f534164
commit 31f06f5724
15 changed files with 110 additions and 39 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ type NativeFileHandle
#borrow(path, mode)
extern "C" fn file_open_ffi(path : Bytes, mode : Bytes) -> NativeFileHandle = "fopen"
extern "C" fn file_is_null_ffi(handle : NativeFileHandle) -> Bool = "moonbitlang_async_pointer_is_null"
extern "C" fn file_is_null_ffi(handle : NativeFileHandle) -> Bool = "bitlogger_pointer_is_null"
#borrow(buffer)
extern "C" fn file_write_ffi(
+1
View File
@@ -7,6 +7,7 @@ import {
}
options(
"native-stub": [ "stub.c" ],
targets: {
"file_backend_native.mbt": [ "native", "llvm" ],
"file_backend_stub.mbt": [ "js", "wasm", "wasm-gc" ],
+5
View File
@@ -0,0 +1,5 @@
#include <stdint.h>
int32_t bitlogger_pointer_is_null(void *ptr) {
return ptr == 0;
}