mempool

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

该文件实现内存管理,实现原理是开辟大块内存,然后在大内存上分配固定大小的内存块 请在合适的场景使用

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreeSliceMem

func FreeSliceMem(sm *SliceMem)

Types

type SliceMem

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

func NewSliceMem

func NewSliceMem(nodeSize, count int) *SliceMem

* NewSliceMem 创建内存块 * @param nodeSize 每个小块的小大,单位字节 * @param count 每个chunk分配多少个小块

func (*SliceMem) Alloc

func (sm *SliceMem) Alloc() []byte

func (*SliceMem) Free

func (sm *SliceMem) Free(bs []byte)

Jump to

Keyboard shortcuts

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