LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected stack offsets with CLFN

Solved!
Go to solution

@cordm wrote:

@rolfk wrote:

Parameters not fitting into 64-bit are passed as reference (64-bit pointer)


So that means on 64 bit Windows a struct passed by value in the function declaration is actually passed by reference if its size exceeds 8 bytes? I wish I'd known that before..


Yep, even more than that. According to the standard only 1, 2, 4, and 8 byte sized structure parameters are stored directly. Everything else is passed as a reference. This is also what LabVIEW will do with Adapt to Type configured values, so at least under Win64 the LabVIEW Adapt To Type option works for all clusters not having above mentioned size.

No such joy for structures defined to be passed by value on Win32 though. They are copied byte for byte onto the stack and LabVIEW does not support that other than you taking the effort to pull everything apart and pass it as individual 32-bit parameters.

Rolf Kalbermatter
My Blog
Message 11 of 11
(242 Views)