Re: life-time pinning. vs Global heap
- From: "Chris Mullins [MVP - C#]" <cmullins@xxxxxxxxx>
- Date: Thu, 3 Jan 2008 12:53:34 -0800
My personal experience is that the best bet is to:
- Allocate a big byte array at the start of your program. This ends up
coming out of the Large Object Heap.
- Pin the array using the GC Handle.
- use ArraySegment<T> to partition the big array during the lifetime of your
app...
--
Chris Mullins
"TheMadHatter" <TheMadHatter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68646A13-E464-44E2-975A-D2445D163828@xxxxxxxxxxxxxxxx
I am very sorry to bring a topic up that has been beaten with an ugly
stick..... but...
If I want to "fix" an byte array for the life time of a program would it
be
better allocating it on the unmanaged heap?
Yes I know that if I am to pin the object for long periods of time, that
it
would be best to do it at the very initial start of the program so that it
prevents some fragmentation of the managed heap.
Thanks in advance for your thoughts on the matter.
.
- Follow-Ups:
- Re: life-time pinning. vs Global heap
- From: TheMadHatter
- Re: life-time pinning. vs Global heap
- Prev by Date: strange
- Next by Date: Re: Registering Event Handlers in C# vs. VB .NET
- Previous by thread: Re: life-time pinning. vs Global heap
- Next by thread: Re: life-time pinning. vs Global heap
- Index(es):
Relevant Pages
|