[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Marshal.AllocHGlobal in 64 bit Vista

assaf

6/11/2007 5:51:00 PM

Hello all.

I see that Marshal.AllocHGlobal is always returning memory in a 32 bit
memory address.
Can I be assured that this will always be the case?


Thanks.

Assaf

1 Answer

Willy Denoyette [MVP]

6/14/2007 12:03:00 AM

0

"assaf" <assafwo@gmail.com> wrote in message
news:234E787E-E36E-4804-ADCA-C5C11702ABEA@microsoft.com...
> Hello all.
>
> I see that Marshal.AllocHGlobal is always returning memory in a 32 bit
> memory address.
> Can I be assured that this will always be the case?
>
>
> Thanks.
>
> Assaf


The address returned is a 64 bit value. The memory manager will return an
address that is below 4GB as long as there is free space below 4GB, however,
there is no hard guarantee that you would never get an address back that is
> 4GB, so, I would not count on it.
Just curious, why do you need to know that? If you want the guaranteed to
get an address back that is < 4GB, you should compile for 32 bit.
Willy.