File: tm_malloc.h

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (31 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _TM_MALLOC_H_
#define _TM_MALLOC_H_

#include <stdlib.h>
#include "ompi_config.h"

OMPI_HIDDEN void *tm_malloc(size_t size, char *, int);
OMPI_HIDDEN void *tm_calloc(size_t count, size_t size, char *, int);
OMPI_HIDDEN void *tm_realloc(void *ptr, size_t size, char *, int);
OMPI_HIDDEN void tm_free(void *ptr);
OMPI_HIDDEN void tm_mem_check(void);

/* for debugging malloc */
/* #define __DEBUG_TM_MALLOC__ */
#undef __DEBUG_TM_MALLOC__
#ifdef __DEBUG_TM_MALLOC__
#define MALLOC(x) tm_malloc(x,__FILE__,__LINE__)
#define CALLOC(x,y) tm_calloc(x,y,__FILE__,__LINE__)
#define REALLOC(x,y) tm_realloc(x,y,__FILE__,__LINE__)
#define FREE   tm_free
#define MEM_CHECK tm_mem_check
#else
#define MALLOC    malloc
#define CALLOC    calloc
#define FREE      free
#define REALLOC   realloc
#define MEM_CHECK tm_mem_check
#endif


#endif