1
This commit is contained in:
parent
0cda98b651
commit
56e52ca357
@ -10,7 +10,7 @@ struct BufHead
|
||||
namespace a8
|
||||
{
|
||||
|
||||
FifoBuffer::FifoBuffer(unsigned int buf_len)
|
||||
FifoBuffer::FifoBuffer(int buf_len)
|
||||
{
|
||||
if (buf_len <= 0) {
|
||||
abort();
|
||||
@ -27,12 +27,12 @@ namespace a8
|
||||
buf_len_ = 0;
|
||||
}
|
||||
|
||||
char* FifoBuffer::Alloc(unsigned int len)
|
||||
char* FifoBuffer::Alloc(int len)
|
||||
{
|
||||
if (len <= 0) {
|
||||
abort();
|
||||
}
|
||||
unsigned int real_len = len + sizeof(BufHead);
|
||||
int real_len = len + sizeof(BufHead);
|
||||
}
|
||||
|
||||
void FifoBuffer::Free(char* p)
|
||||
|
@ -9,19 +9,19 @@ namespace a8
|
||||
{
|
||||
public:
|
||||
|
||||
FifoBuffer(unsigned int buf_len);
|
||||
FifoBuffer(int buf_len);
|
||||
~FifoBuffer();
|
||||
|
||||
char* Alloc(unsigned int len);
|
||||
char* Alloc(int len);
|
||||
void Free(char* p);
|
||||
|
||||
private:
|
||||
|
||||
char* buf_ = nullptr;
|
||||
unsigned int buf_len_ = 0;
|
||||
std::atomic<unsigned int> head_ = 0;
|
||||
std::atomic<unsigned int> tail_ = 0;
|
||||
std::atomic<unsigned int> capacity_ = 0;
|
||||
int buf_len_ = 0;
|
||||
std::atomic<int> head_ = 0;
|
||||
std::atomic<int> tail_ = 0;
|
||||
std::atomic<int> capacity_ = 0;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user