prime/include/Kyoto/Alloc/CCircularBuffer.hpp
Phillip Stephens 4f851a605b Link CCircularBuffer.cpp
Former-commit-id: 5d82d47660778a7f81c72a2a1a46483417970841
2022-09-10 22:54:54 -07:00

28 lines
562 B
C++

#ifndef __CCIRCULARBUFFER_HPP__
#define __CCIRCULARBUFFER_HPP__
#include <types.h>
class CCircularBuffer {
public:
enum EOwnership {
kOS_Owned,
kOS_NotOwned
};
CCircularBuffer(void* buf, int len, EOwnership owned = kOS_NotOwned);
bool IsWrappedMemory(int offset, int len);
void* Alloc(int len);
void Free(void* ptr, int len);
int GetAllocatedAmount() const;
private:
u8 x0_owned;
void* x4_ptr;
s32 x8_bufferLen;
s32 xc_;
s32 x10_nextFreeAddr;
s32 x14_;
};
#endif // __CCIRCULARBUFFER_HPP__