Code cleanup
This commit is contained in:
parent
8081bc5d67
commit
7105c570d9
9 changed files with 106 additions and 138 deletions
|
|
@ -1,27 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace GC
|
||||
{
|
||||
|
||||
struct Chunk
|
||||
{
|
||||
bool marked;
|
||||
uintptr_t *start;
|
||||
size_t size;
|
||||
bool m_marked {false};
|
||||
uintptr_t *const m_start {nullptr};
|
||||
const size_t m_size {0};
|
||||
|
||||
// Default constructor
|
||||
Chunk() {}
|
||||
Chunk(const Chunk *const c) : marked(c->marked), start(c->start), size(c->size) {}
|
||||
|
||||
// -- Temporary --
|
||||
// A copy constructor, keep track of how many times the vectors that hold chunks
|
||||
// are copied.
|
||||
// Shouldn't be all that relevant if we use vectors with Chunk-pointers.
|
||||
Chunk(const Chunk& c) : marked(c.marked), start(c.start), size(c.size)
|
||||
{
|
||||
// std::cout << "Chunk was copied" << std::endl;
|
||||
}
|
||||
Chunk(size_t size, uintptr_t *start) : m_size(size), m_start(start) {}
|
||||
Chunk(const Chunk *const c) : m_marked(c->m_marked), m_start(c->m_start), m_size(c->m_size) {}
|
||||
Chunk(const Chunk& c) : m_marked(c.m_marked), m_start(c.m_start), m_size(c.m_size) {}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue