eclipse-zenoh / zenoh-pico

Eclipse zenoh for pico devices
Other
112 stars 72 forks source link

Consider replacing ptr field in non-ref counted owned objects with value. #475

Closed DenisBiryukov91 closed 3 months ago

DenisBiryukov91 commented 3 months ago

Describe the release item

I.e instead of #define _Z_OWNED_TYPE_PTR(type, name) typedef struct { type *_val; } z_owned_##name##_t;

consider using

#define _Z_OWNED_TYPE_PTR(type, name) typedef struct { type _val; } z_owned_##name##_t;

This would allow unifying layout of owned/loaned objects (which is very desirable for cpp) and also greatly reduce amount of malloc calls.