19.01.2012, 04:58
(
Последний раз редактировалось Slice; 19.01.2012 в 06:57.
)
Quote:
There's a fairly major bug in this version. Currently you're doing "idx = idx + 1 & max;" to get the next index to store in. A very common use case is to set up a load of permanent resources (in this case pointers) at the start of the mode (which would result in them being at the start of the array), and then assign and release more temporary pointers as the mode goes. With your current code this will destroy the initial pointers after a while, but I have no idea for a solution (and I suspect you knew this already so I'm not sure why I'm posting).
|
Pointer variables hold the absolute address to another variable, not a pointer index.
This, of course, results in a function call each time a pointer is used, which isn't optimal sometimes. I'm thinking there should be a more static way to create pointers as well, but there are some problems that has to be solved before that's possible.
Edit: After some testing, I've now updated the include to a version without these indexes. Memory usage were now reduced a lot and I increased the max index limit to 1024.
PointerByAddress now consists of only 4 instructions!