OpenCores
URL https://opencores.org/ocsvn/minimips_superscalar/minimips_superscalar/trunk

Subversion Repositories minimips_superscalar

[/] [minimips_superscalar/] [trunk/] [gasm_with_mult2_instruction/] [include/] [debogueur.h] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 mcafruni
#ifdef DEBUG
2
#ifndef M_DEBUG_FLAG
3
#define M_DEBUG_FLAG
4
 
5
/* La bibliothèque standard doit être incluse avant de déffinir les macros de remplacement   */
6
/* de malloc et free sinon leurs déclarations deviennt fausses.                              */
7
#include <stdlib.h>
8
#include <stdio.h>
9
 
10
/* "Surcharge" des fonctions malloc et free.                                                 */
11
#define malloc(taille)  alloc_debug(taille, __LINE__, __FILE__)
12
#define free(ptr)       free_debug(ptr, __LINE__, __FILE__)
13
 
14
void * alloc_debug(int size, int lg, char * fc);
15
void free_debug(void * ptr, int lg, char * fc);
16
void print_mem(FILE * f);
17
extern int nalloc;
18
 
19
/* Définition d'une macro pour l'enregistrement des pointeurs dans un fichier.               */
20
#define FPRINT_MALLOC   \
21
{\
22
        FILE * f;\
23
        f=fopen("malloc.debug", "wb");\
24
        print_mem(f);\
25
        fclose(f);\
26
}
27
 
28
#endif
29
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.