This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: My arrays in C are too large


On 9/13/2019 7:04 AM, Blair, Charles E III wrote:
I have been using on other machines a program that includes

char *a[50][8192];

but this declaration, by itself, gives "segmentation" errors.

[8192 is BUFSIZ on other machines, although it seems to be 1024 here.
The program uses 50 different permutations on strings of size BUFSIZ.]

It's surprising to me, since that is 50 * 8192 = 400K char * pointers,
which is likely 1600K bytes (assuming a 32-bit machine).  Not tiny,
but well within the scope of modern machines.  The strings themselves
are what will take a lot of space, unless a lot of the pointers are
NULL or something.  There would seem to be something else going on.
Can you reduce this to the smallest failing example?

Regards - EM

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]