Test that DynamicJsonBuffer returns a different pointer after each alloc()

This commit is contained in:
Benoit Blanchon committed 2014-12-13 10:03:01 +01:00
1 parent 0d57fe5a7e
commit ada588c112
2 files changed
+11 -1

No files matched your search

+5 -1
View File
@@ -21,10 +21,14 @@ class DynamicJsonBuffer : public JsonBuffer {
protected:
virtual void* alloc(size_t bytes) {
void* p = _buffer + _size;
_size += bytes;
return NULL;
return p;
}
static const size_t BLOCK_CAPACITY = 32;
size_t _size;
uint8_t _buffer[BLOCK_CAPACITY];
};
}