testallocator

package
v0.0.0-...-243bb06 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoAllocC

func DoAllocC(size int)

DoAllocC does an allocation purely in C without invoking cgo's malloc wrapper.

func DoAllocGo

func DoAllocGo(size int)

DoAllocGo does an allocation with C.malloc, which is special because cgo creates a wrapper that panics on NULL returns from malloc and lets 0-byte allocations succeed.

func DoCalloc

func DoCalloc(size int)

DoCalloc invokes calloc from Go, which should *not* be get a special wrapper.

func DoLibcAlloc

func DoLibcAlloc()

DoLibcAlloc calls a libc function (in this case, strdup) which is documented to allocate memory using malloc. This is for testing that we can intercept references to malloc which might happen in dynamic libraries and thus can't be detected at compile-time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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