Documentation
¶
Overview ¶
Copyright (C) BABEC. All rights reserved. Copyright (C) THL A29 Limited, a Tencent company. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Copyright (C) THL A29 Limited, a Tencent company. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Copyright (C) THL A29 Limited, a Tencent company. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func NewFixedBuffer(f *file.File, bufSize int) (*fixedbuffer, error)
- type ZeroMmap
- func (zm *ZeroMmap) Close() error
- func (zm *ZeroMmap) NextAt(offset int64, n int) ([]byte, error)
- func (zm *ZeroMmap) ReadAt(offset int64, n int) ([]byte, error)
- func (zm *ZeroMmap) Size() int64
- func (zm *ZeroMmap) Sync() error
- func (zm *ZeroMmap) Truncate(size int64) error
- func (zm *ZeroMmap) WriteBack() error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
OsPageSize = os.Getpagesize()
)
Functions ¶
Types ¶
type ZeroMmap ¶
type ZeroMmap struct {
// contains filtered or unexported fields
}
concurrent operations are unsafe
func NewZeroMmap ¶
func (*ZeroMmap) NextAt ¶
NextAt 从offset处获取n个字节,如果参数合法,则获取到bytes长度一定为n, offset可以比当前文件的size大,获取的bytes用于写入数据
func (*ZeroMmap) ReadAt ¶
ReadAt 从offset处读取n个字节,除非读到文件末尾,否则读取到的长度一定为n, 其主要用来读取文件的内容
func (*ZeroMmap) Truncate ¶
Truncate 同步文件的大小,一般对文件进行Truncate的时候,同步调用buffer.Truncate,fSize防止从映射区中读取的数据超出文件大小
Click to show internal directories.
Click to hide internal directories.