Posts: 6
Threads: 2
Joined: May 2025
Reputation:
0
The motivation for me was the ability to do array processing on dynamicall sized blobs of data. I wanted to use MEM blocks the same way Pascal lets you allocate arbitrary sized records by using either arrays or pointers to char/byte lists.
I want to have a record/struct ocontaining a status byte, a size allocated byte, plus the dara. Thinking about it I realized I can bump the data up by two bytes/words and just offset the data by that much. That means I can just pass arrays to/from SUBs/PROCs as needed. I was led to that by the info that you can't (shouldn't?) use arrays in UDTs.
How good is the heap tracking on REDIMed arrays? Do I nee to worry about fragmentation right away? Not sure how smart the back-end C compiler's memory anagementt library is.
Posts: 1,053
Threads: 142
Joined: Apr 2022
Reputation:
23
You know what would be very helpful, would be a mini-tutorial series showing all the different common tasks in QB64PE that can be done a lot faster with memory operations, with a simple example of the standard QB64PE method of doing the thing, alongside the memory manipulation method, and an explanation. Then we would have a nice and easy reference to work from all in one place...
Posts: 476
Threads: 37
Joined: Apr 2022
Reputation:
37
it might also be helpful to have side-by-side comparison showing C pointers vs QB64 _Mem methods