LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LV Memory Manager] uPtr data type

Solved!
Go to solution

Could someone tell me the base data type of uPtr returned by the DSNewPtr function (http://zone.ni.com/reference/en-XX/help/371361N-01/lvexcode/aznewptr_dsnewptr/), where this is defined?

 

Looking at line 228 of the excode.h header file (http://zone.ni.com/reference/en-XX/help/371361N-01/lvexcode/labview_manager_functions/), it's of type uChar which is uInt8 and then uint8_t.

notepad++_2017-03-23_13-07-41.png

 

I think I must have made a mistake as I would have expected size_t for the uPtr data type.

 

0 Kudos
Message 1 of 4
(3,497 Views)
Solution
Accepted by matt.baker

The data you get from DSNewPtr is like the data you get from malloc, right? It's whatever you want it to be. malloc returns a void*, implying no particular size. Perhaps here they wanted to imply that you are getting size_t number of uChars. 

0 Kudos
Message 2 of 4
(3,478 Views)

A pointer is typically a U32.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(3,473 Views)

Thanks. I guess that makes sense.

I hate to admit that I misread the uPtr typedef as a uChar data type rather than a pointer (size_t) to a uChar Smiley Embarassed

 

So the uPtr type when using the Call Library Function Node from LV should always be Numeric->Unsigned Pointer-sized Integer to let LV determine x64 or x86.

0 Kudos
Message 4 of 4
(3,463 Views)