mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
31 lines
548 B
Go
31 lines
548 B
Go
//go:build disable_rm
|
|
|
|
package util
|
|
|
|
type RecyclableMemory struct {
|
|
Memory
|
|
}
|
|
|
|
func (r *RecyclableMemory) InitRecycleIndexes(max int) {
|
|
}
|
|
|
|
func (r *RecyclableMemory) GetAllocator() *ScalableMemoryAllocator {
|
|
return nil
|
|
}
|
|
|
|
func (r *RecyclableMemory) SetAllocator(allocator *ScalableMemoryAllocator) {
|
|
}
|
|
|
|
func (r *RecyclableMemory) Recycle() {
|
|
}
|
|
|
|
func (r *RecyclableMemory) NextN(size int) (memory []byte) {
|
|
memory = make([]byte, size)
|
|
r.AppendOne(memory)
|
|
return memory
|
|
}
|
|
|
|
func (r *RecyclableMemory) AddRecycleBytes(b []byte) {
|
|
r.AppendOne(b)
|
|
}
|