- Now NetBuffer and DynamicBuffer agree and the smallest buffer size posible.
- This means that buffers with a initial size of 0 work now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29006 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
52e59b292b
commit
ef93221da6
|
@ -14,7 +14,7 @@
|
|||
|
||||
class DynamicBuffer {
|
||||
public:
|
||||
DynamicBuffer(size_t initialSize = 1);
|
||||
DynamicBuffer(size_t initialSize = 0);
|
||||
~DynamicBuffer();
|
||||
|
||||
DynamicBuffer(const DynamicBuffer& buffer);
|
||||
|
|
|
@ -23,12 +23,12 @@ DynamicBuffer::DynamicBuffer(size_t initialSize) :
|
|||
fDataEnd(0),
|
||||
fInit(B_NO_INIT)
|
||||
{
|
||||
if (initialSize > 0) {
|
||||
if (initialSize >= 0) {
|
||||
fBuffer = new (std::nothrow) unsigned char[initialSize];
|
||||
if (fBuffer != NULL) {
|
||||
fBufferSize = initialSize;
|
||||
fInit = B_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ status_t
|
|||
DynamicBuffer::Insert(const void* data, size_t size)
|
||||
{
|
||||
if (fInit != B_OK)
|
||||
return fInit;
|
||||
return fInit;
|
||||
|
||||
status_t result = _GrowToFit(size);
|
||||
if (result != B_OK)
|
||||
|
|
Loading…
Reference in New Issue