[fpc-pascal] Caching a big file on memory
Eduardo
nec556 at retena.com
Mon Sep 11 18:44:14 CEST 2006
At 18:30 11/09/2006, Jonas wrote:
>On 11 Sep 2006, at 18:09, Eduardo wrote:
>
>> I have a little problem, i participe in the 'Large Compression
>>Benchmark' (http://cs.fit.edu/~mmahoney/compression/text.html) and
>>need to cache the whole enwik8 file (100MB) on memory but when i
>>try to allocate space for it i get a compiler error, saying that
>>maximum is 64MB (67108864). I tried to use $MEMORY
>>200000000,500000000 (200MB stack and 500MB heap) and the compiler
>>switches, but no success.
>
>How are you trying to allocate the memory, and for which target
>operating system are you compiling?
Oppsss, sorry, I have tried to allocate using pointer, direct array
var and pointer to type array
a)
var
p : pointer of byte;
...
GetMem(p,100000000); //100 MB
b)
var
a : array[1..100000000] of byte; //100MB
c)
type
a = array[1..100000000] of byte; //100MB
pa = ^a;
var
p : pa;
...
GetMem(p,sizeof(a));
Also tried changing 100M of byte with 25M of cardinal but got the same error.
Operating system is WinXP SP2. AthlonXP 2000+ and 1.25 GBRam
More information about the fpc-pascal
mailing list