Repository navigation
HeapAlloc/GetProcessHeap PAL support - #849
Conversation
|
CC @jkotas |
| { | ||
| internal unsafe partial class Sys | ||
| { | ||
| [DllImport(Interop.Libraries.CoreLibNative, EntryPoint = "CoreLibNative_MemAlloc")] |
There was a problem hiding this comment.
Could you please add MemFree here as well (I know it may be unused right now - it is just a point in time thing - any reasonable code that is using MemAlloc needs MemFree as well). And change System.Private.Interop to start use this definition so that we do not have redundant ones.
There was a problem hiding this comment.
do you want to add MemReAlloc too?
There was a problem hiding this comment.
I would keep MemReAlloc separate - it is very rarely used.
There was a problem hiding this comment.
but if we are going to get S.P.Interop to use it as you suggested then we have to add it. otherwise we'll split the code in S.P.Interop which may be ok too.
There was a problem hiding this comment.
I think we should have separate files:
- Interop.MemAllocFree.cs - that has malloc and free
- Interop.MemRealloc.cs - that has realloc
|
@jkotas I'll do the refactoring for S.P.Interop in different PR as I need to investigate a couple of issues regarding the MCG attributes and also the DLL name we use in the DllImport on Windows as in some cases I am seeing Kernel32 which I think we shouldn't be using |
| [DllImport(Interop.Libraries.CoreLibNative, EntryPoint = "CoreLibNative_MemAlloc")] | ||
| internal static extern IntPtr MemAlloc(UIntPtr sizeInBytes); | ||
|
|
||
| [DllImport(Libraries.CoreLibNative, EntryPoint = "CoreLibNative_MemFree")] |
There was a problem hiding this comment.
Nit: This line has Libraries.CoreLibNative vs. the previous line Interop.Libraries.CoreLibNative. It would be nice to be consistent, at least within one file.
HeapAlloc/GetProcessHeap PAL support
No description provided.