[Include] pointers.inc - Pointers for PAWN!
#26

Quote:
Originally Posted by ******
Посмотреть сообщение
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).
The only reason I put index in the first place was so it wouldn't get messed up when using multiple pointers in one function call, though I suspect that's not needed when I come to think about it.
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!
Reply


Messages In This Thread
pointers.inc - Pointers for PAWN! - by Slice - 18.01.2012, 08:26
Re: pointers.inc - Pointers for PAWN! - by Ronaldo_raul™ - 18.01.2012, 08:33
Re: pointers.inc - Pointers for PAWN! - by SoUrAv - 18.01.2012, 08:39
Respuesta: pointers.inc - Pointers for PAWN! - by [Nikk] - 18.01.2012, 08:43
Re: pointers.inc - Pointers for PAWN! - by Lorenc_ - 18.01.2012, 08:50
Re: pointers.inc - Pointers for PAWN! - by T0pAz - 18.01.2012, 09:16
Re: pointers.inc - Pointers for PAWN! - by CaHbKo - 18.01.2012, 09:48
Re: pointers.inc - Pointers for PAWN! - by [S]trong - 18.01.2012, 10:20
Re: pointers.inc - Pointers for PAWN! - by steki. - 18.01.2012, 10:23
Re: pointers.inc - Pointers for PAWN! - by Niko_boy - 18.01.2012, 11:07
Re: pointers.inc - Pointers for PAWN! - by System64 - 18.01.2012, 11:14
Re: pointers.inc - Pointers for PAWN! - by CaHbKo - 18.01.2012, 11:30
Re: pointers.inc - Pointers for PAWN! - by Slice - 18.01.2012, 12:10
Re: pointers.inc - Pointers for PAWN! - by Ricop522 - 18.01.2012, 13:47
Re: pointers.inc - Pointers for PAWN! - by steki. - 18.01.2012, 15:26
Re: pointers.inc - Pointers for PAWN! - by Brian_G - 18.01.2012, 16:11
Re: pointers.inc - Pointers for PAWN! - by KingHual - 18.01.2012, 16:39
Re: pointers.inc - Pointers for PAWN! - by RyDeR` - 18.01.2012, 16:42
Re: pointers.inc - Pointers for PAWN! - by Zh3r0 - 18.01.2012, 17:11
Re: pointers.inc - Pointers for PAWN! - by steki. - 18.01.2012, 17:13
Re: pointers.inc - Pointers for PAWN! - by Zh3r0 - 18.01.2012, 17:17
Re: pointers.inc - Pointers for PAWN! - by steki. - 18.01.2012, 17:21
Re: pointers.inc - Pointers for PAWN! - by CaHbKo - 18.01.2012, 17:43
Re: pointers.inc - Pointers for PAWN! - by Slice - 18.01.2012, 17:50
Respuesta: pointers.inc - Pointers for PAWN! - by Adoniiz - 19.01.2012, 02:37
Re: pointers.inc - Pointers for PAWN! - by Slice - 19.01.2012, 04:58
Re: pointers.inc - Pointers for PAWN! - by The King's Bastard - 01.02.2012, 20:51
Re: pointers.inc - Pointers for PAWN! - by Slice - 02.02.2012, 06:42
Re: pointers.inc - Pointers for PAWN! - by The King's Bastard - 02.02.2012, 07:45
Re: pointers.inc - Pointers for PAWN! - by (LifeStealeR) - 02.02.2012, 08:32
Re: pointers.inc - Pointers for PAWN! - by Slice - 13.06.2012, 13:57
Re: pointers.inc - Pointers for PAWN! - by Hiddos - 13.06.2012, 14:38
Re: pointers.inc - Pointers for PAWN! - by Slice - 25.06.2012, 07:06
Re: pointers.inc - Pointers for PAWN! - by Яlackon - 28.07.2012, 22:04
Re: pointers.inc - Pointers for PAWN! - by BMB1 - 28.07.2012, 22:07
Re: pointers.inc - Pointers for PAWN! - by Ballu Miaa - 11.11.2012, 22:40
Re: pointers.inc - Pointers for PAWN! - by Dayvison_ - 27.03.2016, 23:31
Re: pointers.inc - Pointers for PAWN! - by Slice - 27.03.2016, 23:38
Re: pointers.inc - Pointers for PAWN! - by Dayvison_ - 28.03.2016, 00:01
Re: pointers.inc - Pointers for PAWN! - by Kar - 28.03.2016, 00:30
Re: pointers.inc - Pointers for PAWN! - by Slice - 28.03.2016, 08:20
Re: pointers.inc - Pointers for PAWN! - by Dayvison_ - 28.03.2016, 14:26
Re: pointers.inc - Pointers for PAWN! - by Slice - 28.03.2016, 16:18
Re: pointers.inc - Pointers for PAWN! - by Spmn - 25.05.2016, 20:56
Re: pointers.inc - Pointers for PAWN! - by Yashas - 26.05.2016, 04:29
Re: pointers.inc - Pointers for PAWN! - by Ivan_Ino - 26.05.2016, 11:24
Re: pointers.inc - Pointers for PAWN! - by vannesenn - 26.05.2016, 15:43
Re: pointers.inc - Pointers for PAWN! - by Yashas - 01.03.2017, 10:22
Re: pointers.inc - Pointers for PAWN! - by Nero_3D - 02.03.2017, 23:15
Re: pointers.inc - Pointers for PAWN! - by nG Inverse - 31.07.2017, 00:24
Re: pointers.inc - Pointers for PAWN! - by Damian - 08.03.2019, 14:46

Forum Jump:


Users browsing this thread: 1 Guest(s)