ReconstructMe SDK  1.1.739-75658
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups Pages
Memory Management and Thread Safety

Memory Management Rules and Thread Safety

This page familiarizes you with principal management rules and thread safety of the ReconstructMe API.

Memory Management Rules

The lifetime of pointers provided by the ReconstructMe SDK or to the ReconstructMe SDK is subject to the following rules

The following snippet shows the above rules applied to out- and ref-parameters.

const char *version_str;
int length;
reme_context_get_version(c, &version_str, &length);
printf("Version running: %s", version_str);
// You must not free/delete version_str
const char *err_str;
reme_context_get_first_error(c, &err_str, &length);
// At this point version_str might have been invalidated.

The following snippet shows the above rules applied to in-parameters.

float *mat = (float*)malloc(16 * sizeof(float));
// You are responsible for freeing/deleting in parameters
free(mat);

Thread Safety

In general each instance of a reme_context_t object has to be called by a single thread.