W
Walter Dnes (delete the 'z' to get my real address
I've noticed a few threads (full of sound and fury, signifying
nothing) here recently about allocation of large memory blocks. I'm
about to start on a personal pet project where I'll be using memchr(),
memcmp(), memmove() a lot. Is there an ANSI C maximium size for
character arrays which are guaranteed to succeed, assuming the machine
has sufficient memory? And will the memxxx() functions work with that
size? I'm looking at hopefully 65792 bytes ( == 64K + 256, long story,
don't ask) in a memory block. I could get by with less, but the program
code would be clunkier. I could put up with some disk-thrashing, but I
obviously don't want the program dumping core.
My home platform is linux+gcc. I need to be compatable with the
Windows 32-bit world, but not necessarily ancient real-mode DOS. If the
max size is implementation-specific, is there a standard variable that I
can look up at run/compile time? Also, are there any advantages to
malloc(), versus declaring an array at compile time (other than the need
to macro-ize the array dimension in a regular declaration)?
nothing) here recently about allocation of large memory blocks. I'm
about to start on a personal pet project where I'll be using memchr(),
memcmp(), memmove() a lot. Is there an ANSI C maximium size for
character arrays which are guaranteed to succeed, assuming the machine
has sufficient memory? And will the memxxx() functions work with that
size? I'm looking at hopefully 65792 bytes ( == 64K + 256, long story,
don't ask) in a memory block. I could get by with less, but the program
code would be clunkier. I could put up with some disk-thrashing, but I
obviously don't want the program dumping core.
My home platform is linux+gcc. I need to be compatable with the
Windows 32-bit world, but not necessarily ancient real-mode DOS. If the
max size is implementation-specific, is there a standard variable that I
can look up at run/compile time? Also, are there any advantages to
malloc(), versus declaring an array at compile time (other than the need
to macro-ize the array dimension in a regular declaration)?