> When kernel/crtdll/msvcrt memory allocations are p/invoked from
> managed (C#) code; where exactly is that memory allocated?
On the heap that these functions normally use when called from unmanaged
code. Each of these functions will have its own heap, and not interfere
with the managed heap.
It is actually faster to use an unmanaged heap and copy memory back and
forth between the unmanaged and managed heap in interop scenarios, as simply
pinning the managed heap hurts allocation and collection performance. The
speed improvement isn't important for most scenarios, but if heavy interop
is being used, unmanaged heaps can actually lead to noticeable performance
gains.
Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org
> When kernel/crtdll/msvcrt memory allocations are p/invoked from
> managed (C#) code; where exactly is that memory allocated? Does
[quoted text clipped - 3 lines]
>
> - Arthur
Arthur Mnev - 24 Sep 2003 04:56 GMT
Thanks for the reply, this is exactly what i was looking for. Running
a few tests will post results soon.
> > When kernel/crtdll/msvcrt memory allocations are p/invoked from
> > managed (C#) code; where exactly is that memory allocated?
[quoted text clipped - 22 lines]
> >
> > - Arthur