I am reformulating the question since it was apparently unclear. One of the comments made me find the correct programming language "syntax" for what I wanted to do(Thanks Nasser).
In this stack it was found that mathematica is slow in matrix-scalar multiplications because it copies inputs before executing the requested operation. This looks like a "pass-by-value" function call, they solved the problem by calling an external Fortran library and using "shared" which avoided the copying of input. In other words, the solution looked like a "pass-by-reference" for me.
My question: is there a way to "pass-by-reference" without leaving mathematica? I want to do that at the C-code level, to insure that no copying is taking place.
It is not obvious at the user end if copying is taking place internally or not, it certainly wasn't for me at the beginning of the referenced stack, so a way to see if that is the case would be most welcome.
ds = CreateDataStructure["DynamicArray"]See the documentation for DataStructures. HTH. – Craig Carter Mar 02 '24 at 15:52