Memory Bank Numbering
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by dmoc.
If I want to reserve a mem bank and avoid conflict is it ok to use
say 999 as mem bank number, ie, PB won't go creating 998 other
entries in a table somewhere? I expect PB is using a linked list
to store -to- pairings but thought I'd
ask because I may end up using a very large mem bank number.
If I want to reserve a mem bank and avoid conflict is it ok to use
say 999 as mem bank number, ie, PB won't go creating 998 other
entries in a table somewhere? I expect PB is using a linked list
to store -to- pairings but thought I'd
ask because I may end up using a very large mem bank number.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tinman.
One other thing you might want to try, is that if you are not doing something where the pointer to your memory bank is going to change memory location, i.e. if you are using an array to store bank pointers but you will not sort them, you could make the address of your pointer as the memory bank number, i.e.
Depending on your needs for the memory banks, you might then never have any conflicts.
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
Fred is working now to remove memory bank numbers, or at least make them optional. I don't think PureBasic would use the memory banks internally, as they should be for our use.Originally posted by dmoc
If I want to reserve a mem bank and avoid conflict is it ok to use
say 999 as mem bank number, ie, PB won't go creating 998 other
entries in a table somewhere? I expect PB is using a linked list
to store -to- pairings but thought I'd
ask because I may end up using a very large mem bank number.
One other thing you might want to try, is that if you are not doing something where the pointer to your memory bank is going to change memory location, i.e. if you are using an array to store bank pointers but you will not sort them, you could make the address of your pointer as the memory bank number, i.e.
Code: Select all
*some_memory = AllocateMemory(@*some_memory, size, flags)
--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + all updates, PB3.51, Ed3.53)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
You could use my RawMemory library if you are willing to write the Linux version of the code ;)dmoc wrote:"I could remove it soon" - for the next release? It's beginning to cause me a problem because I need to allocate using arbitrary bank numbers but I still want to avoid a Windows specific solution.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
No, every library has it's own set of numbers.dmoc wrote:Related question: gadget numbers have to be unique but does this include window numbers and mem bank numbers? Eg, if I want banks # 0 to 100 does that mean gadget/ window numbers must >100?
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
