|
|
@ -206,13 +206,15 @@ class PROTOBUF_EXPORT SerialArena { |
|
|
|
// Blocks are variable length malloc-ed objects. The following structure
|
|
|
|
// Blocks are variable length malloc-ed objects. The following structure
|
|
|
|
// describes the common header for all blocks.
|
|
|
|
// describes the common header for all blocks.
|
|
|
|
struct Block { |
|
|
|
struct Block { |
|
|
|
|
|
|
|
Block(Block* next, size_t size) : next(next), size(size), start(nullptr) {} |
|
|
|
|
|
|
|
|
|
|
|
char* Pointer(size_t n) { |
|
|
|
char* Pointer(size_t n) { |
|
|
|
GOOGLE_DCHECK(n <= size); |
|
|
|
GOOGLE_DCHECK(n <= size); |
|
|
|
return reinterpret_cast<char*>(this) + n; |
|
|
|
return reinterpret_cast<char*>(this) + n; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Block* next; |
|
|
|
Block* const next; |
|
|
|
size_t size; |
|
|
|
const size_t size; |
|
|
|
CleanupNode* start; |
|
|
|
CleanupNode* start; |
|
|
|
// data follows
|
|
|
|
// data follows
|
|
|
|
}; |
|
|
|
}; |
|
|
|