#ifndef HAVE_SMPI
#undef malloc
#undef calloc
+#undef realloc
#undef free
// Internally disable these overrides (HAVE_SMPI is only defined when building the library)
#define malloc(nbytes) _sampi_malloc(nbytes)
#ifndef SMPI_NO_OVERRIDE_MALLOC
#define malloc(x) smpi_shared_malloc_intercept((x), __FILE__, __LINE__)
#define calloc(x, y) smpi_shared_calloc_intercept((x), (y), __FILE__, __LINE__)
+#define realloc(x, y) smpi_shared_realloc_intercept((x), (y), __FILE__, __LINE__)
#define free(x) smpi_shared_free(x)
#endif
#endif
void* smpi_shared_malloc_intercept(size_t size, const char* file, int line);
void* smpi_shared_calloc_intercept(size_t num_elm, size_t elem_size, const char* file, int line);
+void* smpi_shared_realloc_intercept(void* data, size_t size, const char* file, int line);
void smpi_shared_free(void* data);
#ifdef __cplusplus
} // extern "C"
}
}
+void* smpi_shared_realloc_intercept(void* /*data*/, size_t /*size*/, const char* file, int line)
+{
+ // FIXME
+ XBT_ERROR("%s:%d: using realloc() with SMPI malloc interception is currently not supported", file, line);
+ xbt_die("Please recompile with -DSMPI_NO_OVERRIDE_MALLOC");
+}
+
void* smpi_shared_malloc(size_t size, const char* file, int line)
{
if (size > 0 && smpi_cfg_shared_malloc() == SharedMallocType::LOCAL) {