--- rpl/src/rpl.h 2019/05/16 12:03:01 1.334 +++ rpl/src/rpl.h 2020/03/17 15:30:50 1.341 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.31 - Copyright (C) 1989-2019 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.32 + Copyright (C) 1989-2020 Dr. BERTRAND Joël This file is part of RPL/2. @@ -731,13 +731,29 @@ void *debug_memoire_modification(void *p void debug_memoire_retrait(void *ptr); void debug_memoire_verification(); -pid_t debug_fork(); - -#define malloc(s) debug_memoire_ajout(s, __FUNCTION__, __LINE__, #s) #define free(s) debug_memoire_retrait(s) -#define realloc(s, t) debug_memoire_modification(s, t, \ - __FUNCTION__, __LINE__, #t) -#define fork() debug_fork() +#ifdef RPLCXX +# define malloc(s) debug_memoire_ajout(s, \ + const_cast \ + (reinterpret_cast \ + (const_cast(__FUNCTION__))), __LINE__, \ + const_cast \ + (reinterpret_cast \ + (const_cast(#s)))) +# define realloc(s, t) debug_memoire_modification(s, t, \ + const_cast \ + (reinterpret_cast \ + (const_cast(__FUNCTION__))), __LINE__, \ + const_cast \ + (reinterpret_cast \ + (const_cast(#t)))) +#else +# define malloc(s) debug_memoire_ajout(s, __FUNCTION__, __LINE__, \ + (const unsigned char *) #s) +# define realloc(s, t) debug_memoire_modification(s, t, \ + __FUNCTION__, __LINE__, (const unsigned char *) #t) +#endif +#define fork() debug_fork(s_etat_processus) #endif #ifdef DEBUG_RETURN @@ -1062,6 +1078,7 @@ pid_t debug_fork(); # define d_ex_taille_message __erreur(92) # define d_ex_type_externe_dup __erreur(93) # define d_ex_type_externe_drop __erreur(94) +# define d_ex_simplification __erreur(95) #endif @@ -2556,6 +2573,10 @@ typedef struct processus } struct_processus; #endif +#ifdef DEBUG_MEMOIRE +pid_t debug_fork(struct_processus *s_etat_processus); +#endif + /* ================================================================================