Make the get_reference() method on ThreadAlloc public.
This is required so that we can replace the thread allocator during setup for the library compartmentalisation case.
This commit is contained in:
committed by
David Chisnall
parent
31941eac06
commit
093b3cc650
@@ -92,13 +92,17 @@ namespace snmalloc
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
/**
|
||||
* Returns a reference to the allocator for the current thread. This allows
|
||||
* the caller to replace the current thread's allocator.
|
||||
*/
|
||||
static inline Alloc*& get_reference()
|
||||
{
|
||||
static thread_local Alloc* alloc = &GlobalPlaceHolder;
|
||||
return alloc;
|
||||
}
|
||||
|
||||
public:
|
||||
/**
|
||||
* Public interface, returns the allocator for this thread, constructing
|
||||
* one if necessary.
|
||||
|
||||
Reference in New Issue
Block a user