I saw a recent announcement for BB4W and wanted to play around with it since my job no longer requires me to actively write software and when I did it was a lot of JavaScript so memory management wasn't really anything we thought about too much.
Apologies in advance for what might seem like basic questions I am still trying to absorb how BB4W stores variables in memory using linked lists. I have an interest in graphics and more specifically DirectX9 so thought I'd try and understand more as a hobby.
I was looking at the D3D9LIB.bbc and trying to get an understanding of how it works and came across the following syntax:
Code: Select all
local S%
S%!24=1
S%!28=H%
S%!32=1
As for the code above I think I know what is happening, we have declared a local variable with 4 bytes. This is used as a pointer and we are shifting by 24 bytes and storing an integer 1 moving another 4 bytes and storing another integer ect. So S% is like a pointer. How can we be sure that the memory 24 bytes from S% hasn't already been used for another value by BB4W?
Wouldn't a struct of be a better or safer way to do this?
Thanks