Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/16/2014 in all areas

  1. This is why in 2014, NI will be shipping the new Bifurcated Timeline LabVIEW. For any dataflow with an ambiguous answer, we'll fork the entire universe and provide one answer to each quantum state vector. Even if you find yourself in the wrong timeline, you can take solace in the fact that in one of the various realities, LabVIEW did exactly what you expected it did and that other you is quite happy. Be happy for your self's good fortune! The feature is undocumented because documentation being provided is one of those quantum states that got forked during testing and this universe lost out. But it's in there, nonetheless. I hope you enjoy it!
    1 point
  2. That is not a feature of passing a handle by reference or not, but of the handle itself. Since there is an intermediate pointer, the contents of the handle can be resized without invalidating the handle itself. Of course you now have to be very careful about race conditions as now you can in fact maintain a handle somewhere in your code and change it at any time you like right at the point LabVIEW itself decides to work on the handle. This is a complete nogo. The original question about passing a handle by value or by reference is similar about passing any other variable type by value or reference. The handle itself can only be modified inside the function and passed back to the caller when it is passed by reference. Never mind that because of the intermediate pointer reference inside the handle you can always change the contents of the handle anyways. But you can not change the handle itself if it was passed by value. While you always can modify a handle even if it was passed by value, passing it by reference has potentially some performance benefits. When you pass a handle by value, LabVIEW has to allocate an empty handle to pass it into your function and you then resize it, which is at least one more memory allocation. If you pass the reference of the handle and you do not want to pass some array data into the function anyhow, LabVIEW now can simply pass in a NULL handle and your code only allocates a handle when needed. In the first case you have two allocations (one for the handle pointer and one for the data area in the handle) and then a reallocation for the data pointer. When configuring the handle to be passed by reference you have only the two initial memory allocations and no reallocation at all.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.