native

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package native loads native C and Rust shared-library images without linking Reflektor's Go c-shared runtime support.

Index

Constants

View Source
const MaxExportArguments = 3

MaxExportArguments is the maximum number of machine-word arguments accepted by CallExportWithArgs on every supported platform.

Variables

View Source
var ErrGoSharedLibraryUnsupported = rejection.ErrGoSharedLibraryUnsupported

ErrGoSharedLibraryUnsupported reports that LoadLibrary was given a Go c-shared image. Go c-shared images require the root reflektor package, whose runtime-aware loader intentionally has a larger process footprint.

View Source
var ErrLibraryClosed = errors.New("reflektor/native: library is closed")

ErrLibraryClosed reports an operation on a closed Library.

Functions

This section is empty.

Types

type Library

type Library struct {
	// contains filtered or unexported fields
}

Library is an in-memory native shared library.

func LoadLibrary

func LoadLibrary(data []byte) (*Library, error)

LoadLibrary loads a native C or Rust shared-library image from memory. Images containing a Go runtime are rejected before platform loading begins.

func (*Library) CallExport

func (library *Library) CallExport(name string) error

CallExport resolves and calls a zero-argument exported function.

func (*Library) CallExportWithArgs

func (library *Library) CallExportWithArgs(name string, args ...uintptr) (uintptr, error)

CallExportWithArgs resolves an export, calls it with up to three machine-word arguments, and returns the value from the platform's primary return register.

func (*Library) Close

func (library *Library) Close() error

Close releases library resources. It is safe to call Close more than once.

Directories

Path Synopsis
internal
linuxmem
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT
rejection
Package rejection owns native-loader errors shared by the public package and platform backends without introducing a dependency on Reflektor's root or memmod packages.
Package rejection owns native-loader errors shared by the public package and platform backends without introducing a dependency on Reflektor's root or memmod packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL