• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Really stupid c question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Really stupid c question


  • Subject: Re: Really stupid c question
  • From: Ingvar Nedrebo <email@hidden>
  • Date: Thu, 11 Apr 2002 21:50:24 +0100

On Thursday, April 11, 2002, at 07:34 , Andy Lee wrote:

At 12:09 PM +0200 4/11/02, Ondra Cada wrote:
On Thursday, April 11, 2002, at 11:59 , Brian Williams wrote:
When I try to make a BOOL array like this ->
BOOL test[786432] /*1024 *768 ==786432*/ it crashes. I am guessing that I am
going out of the local memory space? or something like that.

Hmmm, is it local or global? If former, it might be the reason -- I
am not sure of the stack space, but it is quite possible there's no
a free M there. Though, there should be no problem with a global M;
if so, there would be anotehr problem too.

I reproduced the problem pretty easily. All I had to do was declare
the large array in a method and enter the method. I suspect Ondra is
right, there was some upper limit on memory that the program was
hitting when it tried to allocate that big block of memory on the
stack.

The command limit in Terminal:
% limit
cputime unlimited
filesize unlimited
datasize 6144 kbytes
stacksize 512 kbytes
coredumpsize 0 kbytes
memoryuse unlimited
descriptors 256
memorylocked unlimited
maxproc 100

So there is a limit of 1/2 meg for stacksize. This can be changed up to 65Mb (as shown by limit -h, for hard limit).

I.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Really stupid c question (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Really stupid c question
  • Next by Date: Apology & question
  • Previous by thread: Re: Really stupid c question
  • Next by thread: Re: Really stupid c question
  • Index(es):
    • Date
    • Thread