Moving source map to Function.

This commit is contained in:
Ben Vanik
2015-08-01 14:07:13 -07:00
parent 5aa50b3c18
commit b0425f7ee2
13 changed files with 121 additions and 114 deletions

View File

@@ -12,6 +12,7 @@
#include <cstddef>
#include <cstdint>
#include <vector>
namespace xe {
@@ -31,6 +32,11 @@ class Arena {
void Rewind(size_t size);
void* CloneContents();
template <typename T>
void CloneContents(std::vector<T>& buffer) {
buffer.resize(CalculateSize() / sizeof(T));
CloneContents(buffer.data(), buffer.size() * sizeof(T));
}
private:
class Chunk {
@@ -45,7 +51,9 @@ class Arena {
size_t offset;
};
private:
size_t CalculateSize();
void CloneContents(void* buffer, size_t buffer_length);
size_t chunk_size_;
Chunk* head_chunk_;
Chunk* active_chunk_;