ID:132550
 
Does DLL have memory, or it's one time use? Like, if I want to make basic box collision using DLL (for faster calculations) sending all objects around through parameter would be unpractical, so I'd need to send objects to DLL when they are creates, and save them, but if there's no memory, it's impossible.
Sure, the memory is yours to do whatever with. It's a DLL after all.
In response to Stephen001
Any idea if it takes long to call DLL? What about it's speed of execution?
In response to Ripiz
The call itself is pretty immaterial. They may be some wrangling done when returning the char * to BYOND, but that's it I would think.
Everything running as part of your program will be in memory. Where else would anything live? All data, code and objects (which are just piles of data and code) are in memory during a program's execution. Even if you keep data in some other storage (HD, network, etc) you generally still load it into memory then use it.

For your problem specifically, I think you're going overboard. For a basic rectangular collision detection, it's so simple that you aren't really getting any benefit (at elast, I wouldn't think so) from using a DLL. If you call the DLL function, there is a small amount of overhead, even moreso than normal function calls since you have to convert numbers to text and back for Byond DLLs. This overhead is insignificant generally, but the entire function is insignificant; you only have to do 4 tests for this collision detection, and not even that many if one succeeds before the other.
proc/rectCollisionDetect(rect/r1, rect/r2)
return (r1.left > r2.right || r1.right < r2.left || r1.top < r2.bottom || r1.bottom > r2.top)

That should happen so fast that I wouldn't want to guess at which would be faster; the DLL function call and conversion to/from text, or the processing of Byond's byte code and Byond checking the data types behind the scenes.

And since there are other pitfalls of DLLs (I wouldn't let a DLL function run on my PC if it was written by someone I didn't trust), I would say this isn't a good case for DLLs and just let Byond handle it.