|
|
@ -1,7 +1,7 @@ |
|
|
#include "node.hpp"
|
|
|
#include "node.hpp"
|
|
|
|
|
|
|
|
|
#include <mutex>
|
|
|
#include <mutex>
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
#include <cstddef>
|
|
|
#include <cstdlib>
|
|
|
#include <cstdlib>
|
|
|
@ -11,12 +11,18 @@ struct stack_t |
|
|
stack_t *next; |
|
|
stack_t *next; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
struct StackPair |
|
|
|
|
|
{ |
|
|
|
|
|
stack_t &stack; |
|
|
|
|
|
bool &should_gc; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
thread_local static stack_t *g_stack = NULL; |
|
|
thread_local static stack_t *g_stack = NULL; |
|
|
thread_local bool g_should_gc = false; |
|
|
thread_local bool g_should_gc = false; |
|
|
thread_local bool g_initialized = false; |
|
|
thread_local bool g_initialized = false; |
|
|
|
|
|
|
|
|
static std::mutex g_mutex; |
|
|
static std::mutex g_mutex; |
|
|
static std::unordered_map<stack_t*,bool*> g_all_stacks; |
|
|
|
|
|
|
|
|
static std::<stack_t*,bool*> g_all_stacks; |
|
|
|
|
|
|
|
|
node_t* |
|
|
node_t* |
|
|
node_alloc() |
|
|
node_alloc() |
|
|
|