Closed ghost closed 12 years ago
I've gone over this and it's basically a new language feature that mimics memory management. There's a lot more speccing out to do and unanswered questions - and I'm not convinced of the advantages. Could I suggest you look into making a plugin if you think the idea has merit?
Here's an example of how it would work, you would assign it a region of memory in the plugin config.
Then whenever you do this in the code new variable_name It would replace that with the first available memory in the hash and then you would use this to free memory del variable_name
NEW D NEW E SET D,0 SET E,0 ...;More stuff DEL D DEL E
NEW F; Should use the first free memory, which would be were D was SET F,0 ...;More stuff DEL F
Here's an example using defines instead of this hash plugin
define D [:hash]
define E [:hash+1]
SET D,0 SET E,0 ......;Doing more stuff with variables
undefine D; I finished using the variables
undefine E
I can reuse the space without wasting it though
define F [:hash]
:hash