Mail Archives: djgpp/2000/12/06/03:35:25
---- Original Message -----
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Greg Holdridge <greg AT holdridge7 DOT freeserve DOT co DOT uk>
Cc: <djgpp AT delorie DOT com>
Sent: Tuesday, December 05, 2000 9:42 PM
Subject: Re: realloc causing fault
> Your calculations are mistaken. You don't take into account the
> overhead of each allocation (8 bytes per allocated buffer). So in
> fact you allocate much more than 150KB. You also do it very
even so, with 64MB plus virtual mem it should be ok.
> inefficiently: allocating memopry 1 byte at a time, then reallocating
> it for the next byte is about the worst memory usage I could think of.
not one byte, one string. And besides, I need to allocate in array format
because strings are accessed by code. Otherwise access would be very slow,
if for example I used the binary tree structure I use for compression. How
else could this be achieved without pre-allocation the stringtable space (I
suppose if I put the numstrings in the compressed file header? LZW produces
the same number of strings both ways I guess)
> I could try guessing where your program crashes and why, but I don't
> want to guess. Please post the full crash message printed by the
> program, after running symify on it, and please show on the source
I cant do this easily since the fault cause is handled by windows under a
DOS-box and so no frame trace is performed - just a little grey window pops
up telling me 'the DOS program was naughty and has been...' However the
references I get are
_malloc +545
_realloc +40
> If you want to understand that, read the source of malloc and realloc
> in djlsr203.zip. There is a good reason for the address to move up.
Thanks then,
Greg
- Raw text -