Memory allocation problem

Frank Benoit keinfarbton at googlemail.com
Sun Aug 9 01:54:55 PDT 2009


bearophile schrieb:
> In a small program on Windows XP I have to allocate a large chunk of
> RAM, about 1847 MB of RAM. This PC has 2 GB RAM. So I use
> std.c.stdio.malloc(), with DMD v1.042 (or v2.031). But it's not able
> to allocate it, and produces at runtime: Error: Access Violation
> 
> An equal program written in C and compiled with GCC, that allocates
> the same amount of memory using malloc, is able to run (with just a
> little hard disk trashing at the beginning). Do you know why DMD
> doesn't allow me to allocate more RAM, and can this be fixed?
> 
> Bye, bearophile

Is it the malloc that fails (returning null) or the handling of the
block? D arrays afaik can only handle 16e6 elements.



More information about the Digitalmars-d mailing list