--- rpl/src/rpl.h 2010/05/19 09:22:34 1.36 +++ rpl/src/rpl.h 2010/05/25 18:09:45 1.39 @@ -1,6 +1,6 @@ /* ================================================================================ - RPL/2 (R) version 4.0.15 + RPL/2 (R) version 4.0.16 Copyright (C) 1989-2010 Dr. BERTRAND Joël This file is part of RPL/2. @@ -28,10 +28,10 @@ #define _REENTRANT #ifdef Darwin -# define SIGPOLL SIGINFO -# define _DARWIN_C_SOURCE +# define _DARWIN_C_SOURCE #endif + /* ================================================================================ INCLUSIONS @@ -127,6 +127,10 @@ */ #ifndef RPLARGS +# ifdef Darwin +# define SIGPOLL SIGINFO +# endif + // Arrêt par STOP # define SIGFSTOP SIGUSR1 // Démarrage d'un processus fils @@ -137,6 +141,7 @@ # define SIGABORT SIGPROF // Arrêt d'un processus fils depuis autre chose que STOP # define SIGFABORT SIGPOLL +// Nombre d'interruptions disponibles # define d_NOMBRE_INTERRUPTIONS 64 #endif @@ -433,17 +438,23 @@ int sem_getvalue2(sem_t *semaphore, int void analyse_post_mortem(); void *debug_memoire_ajout(size_t taille, const unsigned char *fonction, unsigned long ligne, const unsigned char *argument); +void debug_memoire_initialisation(); void *debug_memoire_modification(void *pointeur, size_t taille, const unsigned char *fonction, unsigned long ligne, const unsigned char *argument); -void debug_memoire_reinitialisation(); void debug_memoire_retrait(void *ptr); void debug_memoire_verification(); +void debug_memoire_verrouillage(); +void debug_memoire_deverrouillage(); + +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() #endif #ifdef DEBUG_RETURN @@ -483,21 +494,6 @@ void debug_memoire_verification(); if (value == 0) BUG(1, uprintf("Value %d\n", value)); sem_destroy(a); }) #endif -#ifdef DEBUG_MALLOC -#define malloc(taille) ({ size_t s = taille; void *p; \ - p = malloc(taille); if (p != NULL) memset(p, 0, s); \ - /*uprintf("[%d-%llu] Allocating %p (%d bytes) at %s() line #%d\n", \ - (int) getpid(), (unsigned long long) pthread_self(), p, \ - (int) s, __FUNCTION__, __LINE__); fflush(stdout); */ p; }) -#endif - -#ifdef DEBUG_FREE -#define free(ptr) ({ void *p = ptr; \ - /*uprintf("[%d-%llu] Freeing %p (%d bytes) at %s() line #%d\n", \ - (int) getpid(), (unsigned long long) pthread_self(), p, \ - (int) sizeof(p), __FUNCTION__, __LINE__); fflush(stdout); */ \ - if (p != NULL) memset(p, 0, sizeof(p)); free(p); }) -#endif /* ================================================================================ @@ -737,6 +733,7 @@ void debug_memoire_verification(); # define d_ex_enregistrement_inexistant __erreur(79) # define d_ex_clef_inexistante __erreur(80) # define d_ex_nom_implicite __erreur(81) +# define d_ex_version_bibliotheque __erreur(82) #endif