Closed
Description
Functions like umf_memory_provider_ops_t *umfOsMemoryProviderOps(void);
should return const ptr.
They return static struct which should not by modified. Otherwise user can do something like this
umf_memory_provider_ops_t *a = umfOsMemoryProviderOps(void);
a.free = myFree();
umfProviderCreate(a, /*...*/);
/*...*/
*b = umfOsMemoryProviderOps(void);
umfProviderCreate(b, /*...*/); // still free is modified.
This change require the change in users code. Unless they use auto
, or they create provider in this way umfProviderCreate(umfOsMemoryProviderOps(), /*...*/);