safemcache

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package safemcache wraps mcache for unsafe context. It's only used by GRPC for now, should be removed in the future after refactoring GRPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cap

func Cap(buf []byte) int

Cap returns the max cap of a buf can be resized to. See comment of `Malloc` for details

func Free

func Free(buf []byte)

Free does nothing if buf is not created by `Malloc`. see comment of `Malloc` for details

func Malloc

func Malloc(size int) []byte

Malloc warps `mcache.Malloc` for unsafe context. You should use `mcache.Malloc` directly if lifecycle of buf is clear It appends a magic number to the end of buffer and checks it when `Free`. Use `Cap` to get the cap of a buf created by `Malloc`

Types

This section is empty.

Jump to

Keyboard shortcuts

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