bytespool

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Copyright 2023-2024 antlabs. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBytes

func GetBytes(n int) (rv *[]byte)

func GetUpgradeRespBytes

func GetUpgradeRespBytes() *[]byte

func PutBytes

func PutBytes(bytes *[]byte)

PutBytes可以接受 不是GetBytes分配出来的内存块 如果不是GetBytes分配出来内存块就移到向下一级移去,每一个索引的数据都是>= page * i + enum.MaxFrameHeaderSize,这样保证取出来的数据是够用的,不会太小。

func PutUpgradeRespBytes

func PutUpgradeRespBytes(bytes *[]byte)

Types

type BytesPool added in v0.0.8

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

func New added in v0.0.8

func New() *BytesPool

func (*BytesPool) Free added in v0.0.8

func (p *BytesPool) Free()

func (*BytesPool) GetBytes added in v0.0.8

func (p *BytesPool) GetBytes(n int) (rv *[]byte)

func (*BytesPool) Init added in v0.0.8

func (p *BytesPool) Init()

func (*BytesPool) IsInit added in v0.0.8

func (p *BytesPool) IsInit() bool

func (*BytesPool) PutBytes added in v0.0.8

func (p *BytesPool) PutBytes(bytes *[]byte)

Jump to

Keyboard shortcuts

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