github.com/primecitizens/pcz/std@v0.2.1/rt0/os_wasi.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  //go:build !noos && wasm && wasip1
     5  
     6  package rt0
     7  
     8  import (
     9  	"github.com/primecitizens/pcz/std/core/alloc"
    10  	"github.com/primecitizens/pcz/std/core/alloc/sbrkalloc"
    11  	"github.com/primecitizens/pcz/std/ffi/wasm/wasi"
    12  )
    13  
    14  var _alloc sbrkalloc.T
    15  
    16  func malloc() alloc.M { return &_alloc }
    17  func palloc() alloc.P { return &_alloc }
    18  
    19  func exit0() {
    20  	wasi.Exit(0)
    21  }