Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI/LB] Intercept realloc and calloc calls for memory consumption
[simgrid.git] / include / smpi / sampi.h
index bdbaa98..6e8a536 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef SAMPI_H_
 #define SAMPI_H_
 
-#include "malloc.h"
+#include <stdlib.h>
 #include <smpi/smpi.h>
 
 #define AMPI_CALL(type, name, args)                                                                                    \
 
 #ifndef HAVE_SMPI
 #define malloc(nbytes) _sampi_malloc(nbytes)
+#define calloc(n_elm,elm_size) _sampi_calloc(n_elm,elm_size)
+#define realloc(ptr,nbytes) _sampi_realloc(ptr,nbytes)
 #define free(ptr) _sampi_free(ptr)
 #endif
 
 SG_BEGIN_DECL()
 
 XBT_PUBLIC void* _sampi_malloc(size_t size);
+XBT_PUBLIC void* _sampi_calloc(size_t n_elm, size_t elm_size);
+XBT_PUBLIC void* _sampi_realloc(void *ptr, size_t size);
 XBT_PUBLIC void _sampi_free(void* ptr);
 
 AMPI_CALL(XBT_PUBLIC int, MPI_Iteration_in, (MPI_Comm comm))