Skip to content

Releases: JupiterRider/ffi

v0.3.0

18 Jan 17:29
Compare
Choose a tag to compare

Added

  • libffi's closure API has been implemented, which allows you to create C functions at runtime:
    • func ClosureAlloc(size uintptr, code *unsafe.Pointer) *Closure
    • func ClosureFree(writable *Closure)
    • func PrepClosureLoc(closure *Closure, cif *Cif, fun uintptr, userData, codeLoc unsafe.Pointer) Status
  • The new types Fun and Lib can reduce boilerplate and eliminate platform-dependent code:
    • func (f Fun) Call(ret any, args ...any)
    • func Load(name string) (l Lib, err error)
    • func (l Lib) Close() error
    • func (l Lib) Get(name string) (addr uintptr, err error)
    • func (l Lib) Prep(name string, ret *Type, args ...*Type) (f Fun, err error)
    • func (l Lib) PrepVar(name string, nFixedArgs int, ret *Type, args ...*Type) (f Fun, err error)
  • New method func (a Arg) Bool() bool added.
  • Changelog file added.

Changed

  • On Linux, libffi.so.7 was loaded when libffi.so.8 could not be found. This is no longer the case.