May 05, 2024, 02:30:46 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Data size warning

Started by Bruce Peaslee, December 21, 2005, 11:17:01 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bruce Peaslee

I'm fooling arround with an array of a structure. If the array is given 2 elements, the program works as expected; but if I give it 200 elements, I get:

"Warning: local data size 766400 bytes in subroutine 'main' ".  It doesn't run.

(If I pursue this propject, I will probably use linked lists.)
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Parker

That means you've exceeded the allocated stack size, which is not a good idea to do. I wrote some functions for using linked lists, see here:

http://www.ionicwind.com/forums/index.php?topic=39.0

Once operator overloading is supported we can write a class that uses linked lists as if they were arrays.

Zen

Hey using linked lists like arrays sounds cool.

Lewis

Ionic Wind Support Team

And you can increase your stack size in the 'Advanced' tab of the executable options dialog.
Ionic Wind Support Team

Zen

Ive never once changed the default stack size. I im not sure what it does. I know that it is basicly how much memory is allocated to your application but appart from that...

Lewis

Parker

If you learn a little about assembly, you'll learn about the "stack" which stores local variables in subroutines, parameters, and can be used for other stuff. It has a limit though, which is set by the linker. Personally, I think if you have that much data in a subroutine, maybe it's time to think about some other types of structures though.

Zen

Hmm well ive not had that trouble so ive not had to look into it. Learning assembley code is something else i would like to look into when i have time.

I did a little at university, programming Z80 processors. Was fun until you made a mistake and you had to reset the whole thing. But i dont remember much of that, it was only a short course.

Lewis

Parker

I've started reading the ebook that Paul recommends, combined with random findings, and I'm learning a lot. It's really a good thing to know, especially if you're going to write a compiler eventually.