Heap
Re: Heap
help this link?
http://www.purebasic.fr/blog/?p=55
http://www.purebasic.fr/blog/?p=55
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: Heap
Not help.STARGÅTE wrote:help this link?
http://www.purebasic.fr/blog/?p=55
How to get heap_base & heap_addr to use with the:
*mem_id = HeapReAlloc_(
?
See ya... 

Re: Heap
Use API or PB, ReAllocateMemory should do it.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Heap
Work effectively only through:ts-soft wrote:Use API or PB, ReAllocateMemory should do it.
function HeapReAlloc(
hHeap: THandle;
dwFlags: DWORD;
lpMem: Pointer;
dwBytes: DWORD
): Pointer; stdcall;
So I'm asking how to get hHeap and lpMem, for use in PureBasic
by calling
HeapReAlloc_(
I do not need approval, I need a working example

See ya... 

Re: Heap
Code: Select all
Define *mem = HeapAlloc_(GetProcessHeap_(), $08, 100)
Define *mem2
If *mem
*mem2 = HeapReAlloc_(GetProcessHeap_(), $08, *mem, 200)
EndIf
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Heap
10x a lot!ts-soft wrote:Code: Select all
Define *mem = HeapAlloc_(GetProcessHeap_(), $08, 100) Define *mem2 If *mem *mem2 = HeapReAlloc_(GetProcessHeap_(), $08, *mem, 200) EndIf
This work:
Code: Select all
*mem = AllocateMemory(100)
PokeL(*mem+$0000, $12345678)
*mem = HeapReAlloc_(GetProcessHeap_(), $08, *mem, 200)
Debug StrU(MemorySize(*mem))
Debug PeekL(*mem+$0000)
See ya... 

Re: Heap
doesn't work on my pc, but this works:
Code: Select all
*mem = AllocateMemory(100)
PokeL(*mem + $0000, $12345678)
*mem = ReAllocateMemory(*mem, 200)
Debug StrU(MemorySize(*mem))
Debug PeekL(*mem + $0000)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: Heap
ts-soft wrote:doesn't work on my pc, but this works:Code: Select all
*mem = AllocateMemory(100) PokeL(*mem + $0000, $12345678) *mem = ReAllocateMemory(*mem, 200) Debug StrU(MemorySize(*mem)) Debug PeekL(*mem + $0000)
May be into the PureBasic exist constant the Heap ID of task, like #PB_HEAP ?
See ya... 
