8 BENSURE_EQ(
t_gc,
nullptr,
"Garbage collector state already initialized.");
10 BENSURE_NE(
t_gc,
nullptr,
"Garbage collector could not be initialized.");
14 "Attempting to delete an uninitialized garbage collector state");
19#ifdef BROOM_FOR_TESTING
55 if (
this == &
other)
return *
this;
56 BENSURE(gc_ ==
other.gc_,
"Expected the garbage collector pointers");
58 "Expected a valid precise root reference");
65 if (
this == &
other)
return *
this;
66 BENSURE(gc_ ==
other.gc_,
"Expected the garbage collector pointers");
67 gc_->UnregisterPreciseRoot(precise_root_ref_);
69 "Expected a valid precise root reference");
70 precise_root_ref_ = gc_->RegisterPreciseRoot(
PreciseRoot(
this));
BroomValue & operator=(const BroomValue &other)
BROOM_INLINE void RegisterExternalRoot(ExternalRoot root)
BROOM_INLINE void RegisterPointer(const void *pointer, Destructor destructor=nullptr)
void * AllocateRawDontRegister(size_t size)
BROOM_INLINE void EnableAutomatedCollection()
BROOM_INLINE void UnregisterExternalRoot(ExternalRoot root)
BROOM_INLINE void DisableAutomatedCollection()
void ForceSlowCollection()
BROOM_INLINE void * RegisterPreciseRoot(PreciseRoot root)
BROOM_INLINE void Pin(const void *pointer, uint32_t how_many=1)
BROOM_INLINE void UnregisterPreciseRoot(void *type_erased_root)
void ForceFastCollection()
#define BENSURE(x, m,...)
#define BASSERT_NE(lhs, rhs, m,...)
#define BENSURE_NE(lhs, rhs, m,...)
#define BENSURE_EQ(lhs, rhs, m,...)
void RegisterWithGc(const void *pointer, Destructor destructor)
void TurnOnGarbageCollection()
void * AllocateRaw(size_t size)
void TurnOffGarbageCollection()
void ShareRaw(const void *pointer, uint32_t how_many)
void UnpinPointer(GarbageCollector *gc, const void *pointer)
GarbageCollector * GetGarbageCollector()
std::add_pointer< void(const void *)>::type Destructor
thread_local GarbageCollector * t_gc
void unregister_external(const void *pointer)
void thread_init(broom_configuration config)
std::queue< T, broom::deque< T > > queue
void register_external(const void *pointer, size_t size)
void force_slow_collection()