-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use mmap in the frozen object manager for WASM
- Loading branch information
1 parent
0cf1432
commit 1e2fe0d
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...clr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/FrozenObjectHeapManager.Wasm.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#pragma warning disable IDE0060 // Remove unused parameter | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
namespace Internal.Runtime | ||
{ | ||
internal unsafe partial class FrozenObjectHeapManager | ||
{ | ||
private static void* ClrVirtualReserve(nuint size) | ||
{ | ||
void* alloc = Interop.Sys.AlignedAlloc(8, size); | ||
if (alloc != null) | ||
{ | ||
NativeMemory.Clear(alloc, size); | ||
} | ||
return alloc; | ||
} | ||
|
||
private static void* ClrVirtualCommit(void* pBase, nuint size) | ||
{ | ||
// Already 'commited'. | ||
return pBase; | ||
} | ||
|
||
private static void ClrVirtualFree(void* pBase, nuint size) | ||
{ | ||
// This will only be called before an OOM. We have no way do a partial unmap, so do not try. | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters