|
Bracken Back
Registered User
Join date: 29 Aug 2007
Posts: 39
|
04-24-2009 12:08
I am sure my answers are in Wiki, but as of yet, I have failed to find them.
What I want to know is what happens to the heap (and the stack also) when the following happens?
The region is restarted. The script is reset (assuming no code does anything to reset lists, etc). The object is taken back to inventory and rerezzed (again assuming no code does anything to reset lists, etc)
My main reason for asking is I wonder what happens to lists and global variables when these happen. I know there is no means in LSL to write to a note card or save data to the server, therefore the data has to remain in memory.
An example I can think of, is suppose I had a vendor script where the owner set several variables about the items (such as price, description, etc) and stored those variables in lists. I am curious how that data is saved so it is never lost.
I appologize for not being able to root this information out on my own. A pointer in the right direction would be appreciated.
Bracken
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
04-24-2009 12:21
For lists and variables:
1) Region Restarts: nothing, the data stays the same 2) Script Resets: the Scripts data is set back to as if it was just compiled. 3) Object taken into inventory: Nothing, the data stays the same from the instant you picked it up into your inventory.
There are a few things lost on region restarts, but not declared variables, same with taking an object into your inventory.
|
|
Viktoria Dovgal
…
Join date: 29 Jul 2007
Posts: 3,593
|
04-24-2009 12:21
From: Bracken Back The region is restarted.
The object is taken back to inventory and rerezzed (again assuming no code does anything to reset lists, etc)
For these two, if the script is running, all the memory state gets written out to disk as a serialized blob, and it's reconstituted when the sim comes back up or the object is re-rezzed. The same thing happens with attachments at region crossings and teleports (and it would for rezzed objects that moved across regions too). For scripts that _aren't_ running, the state is not saved on restarts or sim crossings, but it is saved on inventory takes. From: someone The script is reset (assuming no code does anything to reset lists, etc).
A reset wipes everything. Note that the image is stored away intact for LSO, but under Mono storage gets reevaluated in these situations and you'll see an increase in llGetFreeMemory if there was unused temp space.
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-24-2009 13:10
and sometimes sim crashes will wipe them... but not often.
(that thing with stack/heap being wiped for non running scripts on region change/reset has set back more than a few people trying to be sim friendly)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
04-24-2009 13:13
I concur with the above.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
|
04-24-2009 13:56
The asset servers do not always reliably save script state either. Sometimes you will find your variables have reverted to a previous saved state upon taking to inventory and rezzing later. This is really a factor of sim conditions and mostly affects attachments.
|