Prefer NativeMemory.AlignedAlloc over Marshal.Alloc*
This commit is contained in:
@@ -129,12 +129,7 @@ void CoreCLR::RegisterNativeLibrary(const char* moduleName, const char* modulePa
|
||||
|
||||
void* CoreCLR::Allocate(int size)
|
||||
{
|
||||
#if PLATFORM_WINDOWS
|
||||
void* ptr = CoTaskMemAlloc(size);
|
||||
#else
|
||||
void* ptr = malloc(size);
|
||||
#endif
|
||||
|
||||
void* ptr = Platform::Allocate(size, 16);
|
||||
#if COMPILE_WITH_PROFILER
|
||||
Platform::OnMemoryAlloc(ptr, size);
|
||||
#endif
|
||||
@@ -146,9 +141,5 @@ void CoreCLR::Free(void* ptr)
|
||||
#if COMPILE_WITH_PROFILER
|
||||
Platform::OnMemoryFree(ptr);
|
||||
#endif
|
||||
#if PLATFORM_WINDOWS
|
||||
CoTaskMemFree(ptr);
|
||||
#else
|
||||
free(ptr);
|
||||
#endif
|
||||
Platform::Free(ptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user