Refactor capptr_domesticate SFINAE to make more statically safe.
This refactoring was provided by David. Previously if a backend provided a capptr_domesticate function with the wrong type it would be silently ignored. This change requires backends to explicitly opt in to domestication via a new Backend::Option and ensures the compiler will loudly complain if there is a mismatch.
This commit is contained in:
committed by
David Chisnall
parent
bf54eeb7be
commit
f277cf2f00
@@ -86,6 +86,13 @@ namespace snmalloc
|
||||
* the queue nodes themselves (which are always considered Wild)?
|
||||
*/
|
||||
bool QueueHeadsAreTame = true;
|
||||
|
||||
/**
|
||||
* Does the backend provide a capptr_domesticate function to sanity check
|
||||
* pointers? If so it will be called when untrusted pointers are consumed
|
||||
* (on dealloc and in freelists) otherwise a no-op version is provided.
|
||||
*/
|
||||
bool HasDomesticate = false;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user