github.com/moontrade/wavm-go@v0.3.2-0.20220316110326-d229dd66ad65/worker/cgo_unsafe.go (about)

     1  //go:build !cgo_safe && !libfuzzer
     2  // +build !cgo_safe,!libfuzzer
     3  
     4  package worker
     5  
     6  // #include "worker.h"
     7  import "C"
     8  import (
     9  	"unsafe"
    10  
    11  	"github.com/moontrade/wavm-go/unsafecgo"
    12  )
    13  
    14  func callStub() {
    15  	unsafecgo.NonBlocking((*byte)(C.moontrade_stub), 0, 0)
    16  }
    17  
    18  func (w *Worker) doCall() {
    19  	unsafecgo.NonBlocking((*byte)(C.moontrade_call), uintptr(unsafe.Pointer(&w.Args)), 0)
    20  }
    21  
    22  func now() {
    23  	unsafecgo.NonBlocking((*byte)(C.moontrade_now), 0, 0)
    24  }