sharedimage

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sharedimage carries the copy-on-write shared-memory-image runtime that wasm2go emits alongside a translated module.

It lives here as source text rather than as a string literal in the generator because it is ordinary Go that happens to be output: keeping it in .go.txt files means it stays readable, reviewable, and greppable. The only generated parts are the identifiers the surrounding package decides — the package name and the Module field names, which single-package output keeps unexported and multi-package output must export.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Files

func Files(n Names) (map[string][]byte, error)

Files renders the runtime: output filename → formatted Go source. The three files split by platform (mmap / no mmap) and must be emitted together.

Types

type Names

type Names struct {
	Pkg     string // package clause of the generated files
	Module  string // the Module type's name (always "Module" today)
	Memory  string // Module's linear-memory field
	MemSize string // Module's *atomic.Uint64 current-size field
	DataEnd string // Module's data-segment-extent field

	// SaveGlobals is the generated globals-snapshot function (see
	// emitGlobalsSnapshot); multi-package output exports it.
	SaveGlobals string
}

Names are the identifiers the emitting package supplies.

Jump to

Keyboard shortcuts

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