IsFreeMemory(#Memory)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Cardian.

Please:

IsFreeMemory(#Memory)

Return:
0 => False
1 => True

or / and

IsNextFreeMemory(#Memory)

Return:
0 => no MemoryNr available
n => MemoryNr


Comment: Useful for better Memory-Managment.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Voldemort.

http://www.purebasic.com/documentation/ ... emory.html
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Cardian.

??? and ???

"Allocates a contiguous memory area according to the specified size. If the needed memory is available, Result contains the start address of the memory area, else Result is 0. Flags must be 0 for now and will be supported later. If another memory bank was previously allocated with the same #Memory number, then the previous memory bank is automatically freed."

Example:
Is Nr 12345 now free? I will not the old data lose or allocate!
How know you the next free MemoryNr? Without the old data to overwrite.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

Cardian, indeed that would be a useful command if you look on how the PB memory commands work today, but Fred has mentioned that he will change the memory library, so chances are slim(i assume) that he will add this right now. Who knows, maybe you wont need a command like this in the next reincarnation of this library. For the time being i would recommend you to look at the API command GlobalAlloc_() it's really easy and you get full control over the memory management..
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Cardian.

Cool, i'm waiting. I know GlobalAlloc_(), but PB must too to better. Thx for the info.
Post Reply