alignment bug (on machines where it matters)
This commit is contained in:
@ -29,11 +29,11 @@
|
|||||||
|
|
||||||
class StreamBuffer
|
class StreamBuffer
|
||||||
{
|
{
|
||||||
|
char local[64];
|
||||||
long len;
|
long len;
|
||||||
long cap;
|
long cap;
|
||||||
long offs;
|
long offs;
|
||||||
char* buffer;
|
char* buffer;
|
||||||
char local[64];
|
|
||||||
|
|
||||||
void grow(long);
|
void grow(long);
|
||||||
void init(const void*, long);
|
void init(const void*, long);
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
// reserve: reserve size bytes of memory and return
|
// reserve: reserve size bytes of memory and return
|
||||||
// pointer to that memory (for copying something to it)
|
// pointer to that memory (for copying something to it)
|
||||||
char* reserve(long size)
|
char* reserve(long size)
|
||||||
{check(size); char* p=buffer+offs+len; len+=size; return p; }
|
{grow(size); char* p=buffer+len; len+=size; return p;}
|
||||||
|
|
||||||
// append: append data at the end of the buffer
|
// append: append data at the end of the buffer
|
||||||
StreamBuffer& append(char c)
|
StreamBuffer& append(char c)
|
||||||
|
Reference in New Issue
Block a user