helpers

package
v0.0.0-...-45b38f9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Allocations tracks number of memory allocations
	Allocations = expvar.Int{}
	// Frees tracks number of memory frees
	Frees = expvar.Int{}
)

Functions

func AssertMemoryExpectation

func AssertMemoryExpectation(t *testing.T, counter expvar.Int, expected int64)

AssertMemoryExpectation makes sure the allocations match the provided value

func AssertMemoryUsage

func AssertMemoryUsage(t *testing.T)

AssertMemoryUsage makes sure the allocations and frees match

func InitMemoryTracker

func InitMemoryTracker()

InitMemoryTracker initializes RTLoader memory tracking

func ResetMemoryStats

func ResetMemoryStats()

ResetMemoryStats resets allocations and frees counters to zero

func TestMemoryTracker

func TestMemoryTracker(ptr unsafe.Pointer, sz C.size_t, op C.rtloader_mem_ops_t)

TestMemoryTracker is the method exposed to the RTLoader for memory tracking

func TrackedCString

func TrackedCString(str string) unsafe.Pointer

TrackedCString retruns an allocation-tracked pointer to a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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