Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Large arrays inside DarkSDK = crash

Author
Message
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 19th Feb 2006 18:24
Hi folks,

You may find this interesting (or know what I'm doin' wrong), or it may not be an issue for you at all!

http://forum.thegamecreators.com/?m=forum_view&t=72183&b=15

Cheers
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 19th Feb 2006 23:39
I guess you sorted it out by now, let me just give you a quick summary on where a program can store its variables.

there are only 3 possible locations where variables can be stored:
1) in your executable (as data statements, they are loaded in memory with all instructions the exe has got, this happens when the process is created).
2) on the stack (this is a memory location which is reserved for your process as long as it runs, and is allocated when the process is loaded into memory).
3) somewhere in memory (that has been allocated dynamically by you).


Now I will try to show when a variable goes into what section.
1) EXE: all data you directly type into your code (numbers, strings...). AND variables you declare globally (outside of functions... somehow I guess also class declaration).
2) STACK: variables you declare in a local function, return variable of functions, and everything that has to do with function calls...(so called stack frame: holds all data that belongs to a CALLED function at runtime)
3) MEM: if you allocate somehing.. and you write into that part, then it is in MEM (everything is actually in mem, if its not swapped out to disk )


Hope I did not make a big mistake.
Any questions left?

greets,
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. --
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 20th Feb 2006 22:25
Thanks Barnski, very helpful indeed.

Cheers

Login to post a reply

Server time is: 2024-05-06 04:18:30
Your offset time is: 2024-05-06 04:18:30