Merge pull request #96 from microsoft/usemalloc_fix

Modified pass through
This commit is contained in:
Matthew Parkinson
2019-11-14 14:48:58 +00:00
committed by GitHub

View File

@@ -125,11 +125,15 @@ namespace snmalloc
*/
static SNMALLOC_FAST_PATH Alloc* get()
{
#ifdef USE_MALLOC
return get_reference();
#else
auto alloc = get_reference();
auto new_alloc = lazy_replacement(alloc);
return (likely(new_alloc == nullptr)) ?
alloc :
reinterpret_cast<Alloc*>(new_alloc);
#endif
}
};