Thread: Re: [Dev-C++] How to increase space for defining arrays
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2009-10-24 23:05:57
|
Are you having problems in FreeBSD? Is there even a kern.maxdsize for MinGW? Are you talking about global arrays, or local on the stack, or dynamically allocated? Uninitialized or initialized arrays? /pwm On Sat, 24 Oct 2009, John Mcelvaney wrote: > > I've searched all day, but I can't find any help for increasing the > size for declaring arrays. I can use a little over 2 meg. I saw > one suggestion about increasing the minGW "kern.maxdsize", > but I can find no info on the web about how to do that. Anybody > have any suggestions? p.s. I'm using Dev C++ version 4.9.9.2 > and minGW32 version 3.2.4. Thanks. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Philip B. <ph...@bl...> - 2009-10-24 23:32:40
|
John, For that kind of a size I'd suggest using dynamic memory instead, the new operator if you're working with C++ or the calloc function if you're using C since it's an array that we're talking about. Pushing that much data directly on the stack seems unwise. Kind regards, Philip Bennefall ----- Original Message ----- From: "John Mcelvaney" <joh...@co...> To: <dev...@li...> Sent: Sunday, October 25, 2009 1:53 AM Subject: [Dev-C++] How to increase space for defining arrays > > I've searched all day, but I can't find any help for increasing the > size for declaring arrays. I can use a little over 2 meg. I saw > one suggestion about increasing the minGW "kern.maxdsize", > but I can find no info on the web about how to do that. Anybody > have any suggestions? p.s. I'm using Dev C++ version 4.9.9.2 > and minGW32 version 3.2.4. Thanks. > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users -------------------------------------------------------------------------------- No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.423 / Virus Database: 270.14.28/2454 - Release Date: 10/23/09 14:09:00 |
|
From: Per W. <pw...@ia...> - 2009-10-25 15:16:12
|
No, there is no "memory is memory" rule. I take it that you were trying to allocate huge amounts of data on the stack. But the stack is not intended for allocation of large memory blocks. Most operating systems requires a fixed memory region to be reserved for the stack. The OS may then allocate more or less memory into this fixed-size region but when the region is full it can't be grown. The information on the net wasn't "noise". If you do a wild-card search without knowing what you are looking for, you must realize that the majority of hits may not be relevant for you - such as how to adjust memory settings in FreeBSD. If you do narrow your searches more, you will get hits closer to your goal. But the best hits would probably recommend you to use dynamic memory instead of changing the size of the memory region reserved for stack data. /pwm On Sun, 25 Oct 2009, John Mcelvaney wrote: > > Thanks all. I figure memory is memory, but I'll try allocating the > space with malloc. > From some of the noise I've read on the web, I thought there was > some adjustment > that could be made to some configuration item, that would allow > larger size arrays to > be declared with minGW. > > > At 06:33 PM 10/24/2009, mi...@na... wrote: > >Two megs? Or "char somvar[2,000,000]"? > > > >If the latter...then that is way more than you'll probably need. That's a > >very large array. Now, if you can only allocate two mB, then something is > >wrong with the compiler, OS or with your code. Try allocating it with malloc > >instead of using a standard array. > > > >-mh. > > > >(sorry for sending to the wrong place the first time, Mr Westermark) > >----- Original Message ----- From: "Per Westermark" <pw...@ia...> > >To: "John Mcelvaney" <joh...@co...> > >Cc: <dev...@li...> > >Sent: Saturday, October 24, 2009 6:05 PM > >Subject: Re: [Dev-C++] How to increase space for defining arrays > > > > > >>Are you having problems in FreeBSD? Is there even a kern.maxdsize for > >>MinGW? > >> > >>Are you talking about global arrays, or local on the stack, or dynamically > >>allocated? Uninitialized or initialized arrays? > >> > >>/pwm > >> > >>On Sat, 24 Oct 2009, John Mcelvaney wrote: > >> > >>> > >>>I've searched all day, but I can't find any help for increasing the > >>>size for declaring arrays. I can use a little over 2 meg. I saw > >>>one suggestion about increasing the minGW "kern.maxdsize", > >>>but I can find no info on the web about how to do that. Anybody > >>>have any suggestions? p.s. I'm using Dev C++ version 4.9.9.2 > >>>and minGW32 version 3.2.4. Thanks. > >>> > >>> > >>>------------------------------------------------------------------------------ > >>>Come build with us! The BlackBerry(R) Developer Conference in SF, CA > >>>is the only developer event you need to attend this year. Jumpstart your > >>>developing skills, take BlackBerry mobile applications to market and stay > >>>ahead of the curve. Join us from November 9 - 12, 2009. Register now! > >>>http://p.sf.net/sfu/devconference > >>>_______________________________________________ > >>>Dev-cpp-users mailing list > >>>Dev...@li... > >>>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >> > >> > >>------------------------------------------------------------------------------ > >>Come build with us! The BlackBerry(R) Developer Conference in SF, CA > >>is the only developer event you need to attend this year. Jumpstart your > >>developing skills, take BlackBerry mobile applications to market and stay > >>ahead of the curve. Join us from November 9 - 12, 2009. Register now! > >>http://p.sf.net/sfu/devconference > >>_______________________________________________ > >>Dev-cpp-users mailing list > >>Dev...@li... > >>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <mi...@na...> - 2009-10-25 00:00:39
|
Two megs? Or "char somvar[2,000,000]"? If the latter...then that is way more than you'll probably need. That's a very large array. Now, if you can only allocate two mB, then something is wrong with the compiler, OS or with your code. Try allocating it with malloc instead of using a standard array. -mh. (sorry for sending to the wrong place the first time, Mr Westermark) ----- Original Message ----- From: "Per Westermark" <pw...@ia...> To: "John Mcelvaney" <joh...@co...> Cc: <dev...@li...> Sent: Saturday, October 24, 2009 6:05 PM Subject: Re: [Dev-C++] How to increase space for defining arrays > Are you having problems in FreeBSD? Is there even a kern.maxdsize for > MinGW? > > Are you talking about global arrays, or local on the stack, or dynamically > allocated? Uninitialized or initialized arrays? > > /pwm > > On Sat, 24 Oct 2009, John Mcelvaney wrote: > >> >> I've searched all day, but I can't find any help for increasing the >> size for declaring arrays. I can use a little over 2 meg. I saw >> one suggestion about increasing the minGW "kern.maxdsize", >> but I can find no info on the web about how to do that. Anybody >> have any suggestions? p.s. I'm using Dev C++ version 4.9.9.2 >> and minGW32 version 3.2.4. Thanks. >> >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Dev-cpp-users mailing list >> Dev...@li... >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >> > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: John M. <joh...@co...> - 2009-10-25 09:16:26
|
Thanks all. I figure memory is memory, but I'll try allocating the space with malloc. From some of the noise I've read on the web, I thought there was some adjustment that could be made to some configuration item, that would allow larger size arrays to be declared with minGW. At 06:33 PM 10/24/2009, mi...@na... wrote: >Two megs? Or "char somvar[2,000,000]"? > >If the latter...then that is way more than you'll probably need. That's a >very large array. Now, if you can only allocate two mB, then something is >wrong with the compiler, OS or with your code. Try allocating it with malloc >instead of using a standard array. > >-mh. > >(sorry for sending to the wrong place the first time, Mr Westermark) >----- Original Message ----- From: "Per Westermark" <pw...@ia...> >To: "John Mcelvaney" <joh...@co...> >Cc: <dev...@li...> >Sent: Saturday, October 24, 2009 6:05 PM >Subject: Re: [Dev-C++] How to increase space for defining arrays > > >>Are you having problems in FreeBSD? Is there even a kern.maxdsize for >>MinGW? >> >>Are you talking about global arrays, or local on the stack, or dynamically >>allocated? Uninitialized or initialized arrays? >> >>/pwm >> >>On Sat, 24 Oct 2009, John Mcelvaney wrote: >> >>> >>>I've searched all day, but I can't find any help for increasing the >>>size for declaring arrays. I can use a little over 2 meg. I saw >>>one suggestion about increasing the minGW "kern.maxdsize", >>>but I can find no info on the web about how to do that. Anybody >>>have any suggestions? p.s. I'm using Dev C++ version 4.9.9.2 >>>and minGW32 version 3.2.4. Thanks. >>> >>> >>>------------------------------------------------------------------------------ >>>Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>>is the only developer event you need to attend this year. Jumpstart your >>>developing skills, take BlackBerry mobile applications to market and stay >>>ahead of the curve. Join us from November 9 - 12, 2009. Register now! >>>http://p.sf.net/sfu/devconference >>>_______________________________________________ >>>Dev-cpp-users mailing list >>>Dev...@li... >>>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >> >> >>------------------------------------------------------------------------------ >>Come build with us! The BlackBerry(R) Developer Conference in SF, CA >>is the only developer event you need to attend this year. Jumpstart your >>developing skills, take BlackBerry mobile applications to market and stay >>ahead of the curve. Join us from November 9 - 12, 2009. Register now! >>http://p.sf.net/sfu/devconference >>_______________________________________________ >>Dev-cpp-users mailing list >>Dev...@li... >>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |