Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename this macro.
authorAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 1 Dec 2019 17:22:40 +0000 (18:22 +0100)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Sun, 1 Dec 2019 17:22:40 +0000 (18:22 +0100)
It's actually useful outside of sampi, to disable malloc override when it conflicts with other codes and is not needed.
Fors instance FFTW uses FFTW(malloc(x)) to actually call fftw_malloc, and our macro was then breaking compilation.

include/smpi/sampi.h
include/smpi/smpi_helpers.h

index 701df11..6ed1aa8 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef SAMPI_H_
 #define SAMPI_H_
 
 #ifndef SAMPI_H_
 #define SAMPI_H_
 
-#define SAMPI_OVERRIDEN_MALLOC
+#define SMPI_NO_OVERRIDE_MALLOC
 #include <stdlib.h>
 #include <smpi/smpi.h>
 
 #include <stdlib.h>
 #include <smpi/smpi.h>
 
index 9a07509..8c47f82 100644 (file)
@@ -32,7 +32,7 @@
 #define getopt(x, y, z) smpi_getopt((x), (y), (z))
 #define getopt_long(x, y, z, a, b) smpi_getopt_long((x), (y), (z), (a), (b))
 #define getopt_long_only(x, y, z, a, b) smpi_getopt_long_only((x), (y), (z), (a), (b))
 #define getopt(x, y, z) smpi_getopt((x), (y), (z))
 #define getopt_long(x, y, z, a, b) smpi_getopt_long((x), (y), (z), (a), (b))
 #define getopt_long_only(x, y, z, a, b) smpi_getopt_long_only((x), (y), (z), (a), (b))
-#ifndef SAMPI_OVERRIDEN_MALLOC
+#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 free(x) smpi_shared_free(x)
 #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)