ReconstructMe SDK  1.1.739-75658
Real-time 3D reconstruction engine
 All Classes Files Functions Typedefs Enumerations Enumerator Groups Pages
example_reconstructmesdk_memory_management.cpp

Content

This is an example illustrating basic memory management rules. Boost is only used to generate examples and is not necessary for working with this SDK.

#include <boost/test/unit_test.hpp>
#include <stdio.h>
BOOST_AUTO_TEST_SUITE(example_reconstructmesdk)
BOOST_AUTO_TEST_CASE(memory_management)
{
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.
float *mat = (float*)malloc(16 * sizeof(float));
// You are responsible for freeing/deleting in parameters
free(mat);
}
BOOST_AUTO_TEST_SUITE_END()