It looks malloc did not allocate memory in that adressrange.

thanks

Re: how can I allocate memory in address 0x4800 0000 (virtual) by K

K
Tue Dec 26 05:02:07 CST 2006

Do you mean you want to allocate some memory in Shared Memory Range?
If you call VirtualAlloc with dwSize >= 2 MB, flAllocationType set to
MEM_RESERVE, and flProtect set to PAGE_NOACCESS, it automatically reserves
memory at the shared memory region. This preserves per-process virtual
memory.


<yuanfei.work@gmail.com>
???????:1167127457.777869.137920@h40g2000cwb.googlegroups.com...
> It looks malloc did not allocate memory in that adressrange.
>
> thanks
>



Re: how can I allocate memory in address 0x4800 0000 (virtual) by luopub

luopub
Wed Dec 27 19:25:34 CST 2006

It's strange: when I allocate a memory of size 0x3456790(PAGE_NOACCESS)
at this address, it's successful; but when I allocate the same size of
memory at 0x2000 0000, it fails.

Why?

K. S. Huang wrote:
> Do you mean you want to allocate some memory in Shared Memory Range?
> If you call VirtualAlloc with dwSize >= 2 MB, flAllocationType set to
> MEM_RESERVE, and flProtect set to PAGE_NOACCESS, it automatically reserves
> memory at the shared memory region. This preserves per-process virtual
> memory.
>
>
> <yuanfei.work@gmail.com>
> ???????:1167127457.777869.137920@h40g2000cwb.googlegroups.com...
> > It looks malloc did not allocate memory in that adressrange.
> >
> > thanks
> >


Re: how can I allocate memory in address 0x4800 0000 (virtual) by Sue

Sue
Thu Jan 04 11:52:09 CST 2007

Don't specify an address when you call VirtualAlloc. Pass address 0 and
it'll return the newly allocated address to you. The only reason to pass an
address to VirtualAlloc is if you already used VirtualAlloc (with addr 0 +
PAGE_RESERVE) to reserve an address range and now you want to use
VirtualAlloc with the reserved address in order to commit. Passing
addresses that you didn't allocate could result in you stealing someone
else's memory.

Address 0x20000000 is not shared memory; you can't use VirtualAlloc to
allocate that address.

Sue
sloh@microsoft.com (remove "online" from reply-to address)
http://blogs.msdn.com/ce_base/
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________