Moderators SmOke_N Posted Wednesday at 05:06 PM Moderators Posted Wednesday at 05:06 PM (edited) A few days ago, I was reviewing some of Koda's historical structure allocation logic. Seeing Global variables being dynamically allocated and re-declared inside local function frames felt structurally messy, which drove me down a design rabbit hole to find a cleaner approach. The source intent was clear: the original layout relied on AutoIt's internal variant interpreter lifecycle to handle structural memory cleanup on the stack. However, pushing cross-module asynchronous tracking elements directly into local scopes breaks standard encapsulation. To break away from stack limits, I shifted the tracking vectors over to unmanaged memory heaps. The initial architecture passes were highly volatile under modern x64 wrappers, frequently throwing un-reclaimable access violations and memory exception errors. To stabilize the runtime engine without cluttering the user space with a massive global tracking layout, I re-explored AutoIt's native Dim engine. Leveraging Extended Dynamic Allocation ($xd_) allowed the framework to dynamically resize, scale, and compact its multi-column 2D tracking matrix pool entirely on the primary thread context. It safely isolates lifetimes across module boundaries with zero stack locks, zero multi-threaded collisions, and zero unmanaged leaks. The result is AutThreadCall, an asynchronous, non-blocking library that runs native windows natively under full multi-call stress runs. The stabilized source modules and test harness scripts are attached below. Review the architecture, run the stress tracks through your local compilers, and let me know your thoughts on the primary thread tracking compaction mechanics. (In addition, I'm well aware I may have been re-inventing the wheel, this was more for me stretch my muscles after so long.) Edit(s): 08/26/2026: @argumentum was kind of enough to point out that I released an earlier version of my code before I put in the actual code to clean up the bad data... Thanks and Fixed. 08/26/2026: @argumentum caught me again, evidently I uploaded one of my SQLite.au3 personal files lol, congrats to those that got it! 08/27/2026: Fixed unbalanced array in AutThreadCall.au3 -> MsgBoxEx() 08/28/2026: Updated to v1.0.3 - Added the sue of WChar OR AChar; I forgot I only tested everything in WChar. Added more functions to AutAPI.au3, including _AutAPI_UseWStr() as well as an example on how to use it 08/28/2026: Fixed example file, was still using _AutAPI_StringCopyW function, but I changed it to _AutAPI_StringCopy when I fixed the WChar issue. I am just going to upload the example files here since I only made the change to the example files. Thanks again @argumentum AutThreadCall.v1.0.3.zip AutThreadCall_Examples.zip Edited Saturday at 01:37 AM by SmOke_N argumentum, WildByDesign and mutleey 2 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Moderators SmOke_N Posted Saturday at 01:39 AM Author Moderators Posted Saturday at 01:39 AM Ok, my buddy @argumentum pointed out that although I fixed the WChar issue in AutThreadCall.au3, I did NOT bother to test the old test file lol, I have since tested it. I've split the example files up. argumentum 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now