* My arrays in C are too large
@ 2019-09-13 11:27 Blair, Charles E III
2019-09-13 12:10 ` Eliot Moss
0 siblings, 1 reply; 2+ messages in thread
From: Blair, Charles E III @ 2019-09-13 11:27 UTC (permalink / raw)
To: cygwin
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.]
-----------------------------------------------------------------------------------
My e-mail system is unreliable. Please write again if you do not receive a reply in a few days. gpg key is available from keyservers.
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: My arrays in C are too large
2019-09-13 11:27 My arrays in C are too large Blair, Charles E III
@ 2019-09-13 12:10 ` Eliot Moss
0 siblings, 0 replies; 2+ messages in thread
From: Eliot Moss @ 2019-09-13 12:10 UTC (permalink / raw)
To: cygwin
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-13 11:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 11:27 My arrays in C are too large Blair, Charles E III
2019-09-13 12:10 ` Eliot Moss
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).