mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-08 21:13:39 +00:00
wasm: add Boehm GC support
This adds support for `-gc=boehm` on `-target=wasip1` and `-target=wasm` (in a browser or NodeJS). Notably it does *not* add Boehm GC support for `-target=wasip2`, since that target doesn't have a real libc.
This commit is contained in:
committed by
Ron Evans
parent
9c3b706533
commit
c08b2dfe06
@@ -124,32 +124,3 @@ func TestMallocFree(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestMallocEmpty(t *testing.T) {
|
||||
ptr := libc_malloc(0)
|
||||
if ptr != nil {
|
||||
t.Errorf("expected nil pointer, got %p", ptr)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCallocEmpty(t *testing.T) {
|
||||
ptr := libc_calloc(0, 1)
|
||||
if ptr != nil {
|
||||
t.Errorf("expected nil pointer, got %p", ptr)
|
||||
}
|
||||
ptr = libc_calloc(1, 0)
|
||||
if ptr != nil {
|
||||
t.Errorf("expected nil pointer, got %p", ptr)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReallocEmpty(t *testing.T) {
|
||||
ptr := libc_malloc(1)
|
||||
if ptr == nil {
|
||||
t.Error("expected pointer but was nil")
|
||||
}
|
||||
ptr = libc_realloc(ptr, 0)
|
||||
if ptr != nil {
|
||||
t.Errorf("expected nil pointer, got %p", ptr)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user