public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eliot Moss <moss@cs.umass.edu>
To: cygwin@cygwin.com
Subject: Re: My arrays in C are too large
Date: Fri, 13 Sep 2019 12:10:00 -0000	[thread overview]
Message-ID: <93c59d26-82dc-8945-045e-6c0bb1f6b0e9@cs.umass.edu> (raw)
In-Reply-To: <CY4PR1101MB2133F5567FF267C1DADD000681B30@CY4PR1101MB2133.namprd11.prod.outlook.com>

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

      reply	other threads:[~2019-09-13 11:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 11:27 Blair, Charles E III
2019-09-13 12:10 ` Eliot Moss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93c59d26-82dc-8945-045e-6c0bb1f6b0e9@cs.umass.edu \
    --to=moss@cs.umass.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).