Compare commits
4 Commits
3e9c69e857
...
b2ce851d56
| Author | SHA1 | Date | |
|---|---|---|---|
| b2ce851d56 | |||
| e11ee26332 | |||
| 0af75f5e9c | |||
| 43ba21329b |
+1
-1
@@ -393,7 +393,7 @@ inline Random seededRandom() {
|
|||||||
return Random{seed[0], seed[1]};
|
return Random{seed[0], seed[1]};
|
||||||
}
|
}
|
||||||
|
|
||||||
static thread_local Random gRandom = seededRandom();
|
inline thread_local Random gRandom = seededRandom();
|
||||||
|
|
||||||
// ==================== END RANDOM IMPL ====================
|
// ==================== END RANDOM IMPL ====================
|
||||||
|
|
||||||
|
|||||||
+14
-4
@@ -285,9 +285,11 @@ struct MemManager {
|
|||||||
void gc(const uint32_t *roots, int numRoots, int64_t oldestVersion) {
|
void gc(const uint32_t *roots, int numRoots, int64_t oldestVersion) {
|
||||||
// Calculate reachable set
|
// Calculate reachable set
|
||||||
BitSet reachable{next};
|
BitSet reachable{next};
|
||||||
// Each node has at most 3 children and nodes along the search path aren't
|
Arena arena;
|
||||||
// in the stack, so we need 2 * kPathLengthUpperBound
|
constexpr int kInitialStackCapacity = 128;
|
||||||
uint32_t stack[2 * kPathLengthUpperBound];
|
int64_t stackCapacity = kInitialStackCapacity;
|
||||||
|
uint32_t stackStack[kInitialStackCapacity];
|
||||||
|
uint32_t *stack = stackStack;
|
||||||
int stackIndex = 0;
|
int stackIndex = 0;
|
||||||
auto tryPush = [&]([[maybe_unused]] uint32_t parent, uint32_t child) {
|
auto tryPush = [&]([[maybe_unused]] uint32_t parent, uint32_t child) {
|
||||||
if (!reachable.set(child)) {
|
if (!reachable.set(child)) {
|
||||||
@@ -296,7 +298,12 @@ struct MemManager {
|
|||||||
printf(" GC: reach: %u (parent %u)\n", child, parent);
|
printf(" GC: reach: %u (parent %u)\n", child, parent);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
assert(stackIndex < int(sizeof(stack) / sizeof(stack[0])));
|
if (stackIndex == stackCapacity) [[unlikely]] {
|
||||||
|
auto *old = stack;
|
||||||
|
stackCapacity *= 2;
|
||||||
|
stack = new (arena) uint32_t[stackCapacity];
|
||||||
|
memcpy(stack, old, stackIndex * sizeof(stack[0]));
|
||||||
|
}
|
||||||
stack[stackIndex++] = child;
|
stack[stackIndex++] = child;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -378,6 +385,9 @@ struct MemManager {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
next = max + 1;
|
next = max + 1;
|
||||||
|
assert(firstUnaddressable >= next);
|
||||||
|
VALGRIND_MAKE_MEM_NOACCESS(base + next,
|
||||||
|
(firstUnaddressable - next) * sizeof(Node));
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t getBytes() const {
|
int64_t getBytes() const {
|
||||||
|
|||||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
~0忖
|
|
||||||
忖���,�������帙������������������������������������ zzzz zzz zz汉汉€zz zzNz zzzz zzz zzz S�堜渲s�5[谠�垐垐垐垐垐垐垐垐����������牋牋牋鞝牋牋牋牋牋������������������������������������������������������������������������垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐垐�����
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
DDDDDDDDDDD
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user