Just starting out? Need help? Post your questions and find answers here.
bingo
Enthusiast
Posts: 210 Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:
Post
by bingo » Fri Dec 05, 2008 7:29 pm
Code: Select all
membuffer.i = AllocateMemory(500)
For i=0 To 5
any.b = PeekB(membuffer)
membuffer = membuffer + 1
Next
FreeMemory(membuffer)
End
:roll:
no error ...
Code: Select all
membuffer.i = AllocateMemory(500)
For i=0 To 5
any.b = PeekB(membuffer+i)
Next
FreeMemory(membuffer)
End
["1:0>1"]
cxAlex
User
Posts: 88 Joined: Fri Oct 24, 2008 11:29 pm
Location: Austria
Contact:
Post
by cxAlex » Fri Dec 05, 2008 7:33 pm
NO BUG!
Code: Select all
membuffer.i = AllocateMemory(500)
startbuffer.i = membuffer
For i=0 To 5
any.b = PeekB(membuffer)
membuffer = membuffer + 1
Next
FreeMemory(startbuffer)
End
Fred
Administrator
Posts: 18253 Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:
Post
by Fred » Fri Dec 05, 2008 7:33 pm
Well, the first code is wrong, as you free something else than the allocated pointer.
bingo
Enthusiast
Posts: 210 Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:
Post
by bingo » Fri Dec 05, 2008 7:35 pm
ok ... sorry . p
inter
["1:0>1"]
Hroudtwolf
Addict
Posts: 803 Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:
Post
by Hroudtwolf » Fri Dec 05, 2008 7:36 pm
Hi,
It isn't a bug.
'Cause it is a incorrect use.
You can just free a memory block with freememory, by using the startaddress of your allocated memory block .
Regards
Wolf