Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add calloc_intercept to avoid mistmatches.
authorAugustin Degomme <adegomme@gmail.com>
Fri, 22 Nov 2019 11:07:05 +0000 (12:07 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Fri, 22 Nov 2019 11:07:29 +0000 (12:07 +0100)
include/smpi/sampi.h
include/smpi/smpi_helpers.h
include/smpi/smpi_helpers_internal.h

index 5e011d9..701df11 100644 (file)
@@ -16,6 +16,7 @@
 
 #ifndef HAVE_SMPI
 #undef malloc
 
 #ifndef HAVE_SMPI
 #undef malloc
+#undef calloc
 #undef free
 // Internally disable these overrides (HAVE_SMPI is only defined when building the library)
 #define malloc(nbytes) _sampi_malloc(nbytes)
 #undef free
 // Internally disable these overrides (HAVE_SMPI is only defined when building the library)
 #define malloc(nbytes) _sampi_malloc(nbytes)
index 55efcf8..9a07509 100644 (file)
@@ -34,6 +34,7 @@
 #define getopt_long_only(x, y, z, a, b) smpi_getopt_long_only((x), (y), (z), (a), (b))
 #ifndef SAMPI_OVERRIDEN_MALLOC
 #define malloc(x) smpi_shared_malloc_intercept(x, __FILE__, __LINE__)
 #define getopt_long_only(x, y, z, a, b) smpi_getopt_long_only((x), (y), (z), (a), (b))
 #ifndef SAMPI_OVERRIDEN_MALLOC
 #define malloc(x) smpi_shared_malloc_intercept(x, __FILE__, __LINE__)
+#define calloc(x,y) smpi_shared_calloc_intercept(x,y, __FILE__, __LINE__)
 #define free(x) smpi_shared_free(x)
 #endif
 #endif
 #define free(x) smpi_shared_free(x)
 #endif
 #endif
index 59aa0df..8a21ead 100644 (file)
@@ -35,6 +35,7 @@ int smpi_getopt_long(int argc, char* const* argv, const char* options, const str
 int smpi_getopt(int argc, char* const* argv, const char* options);
 
 void* smpi_shared_malloc_intercept(size_t size, const char* file, int line);
 int smpi_getopt(int argc, char* const* argv, const char* options);
 
 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_free(void* data);
 #ifdef __cplusplus
 } // extern "C"
 void smpi_shared_free(void* data);
 #ifdef __cplusplus
 } // extern "C"