File: memory.c

package info (click to toggle)
vis5d 4.3-5
  • links: PTS
  • area: main
  • in suites: slink
  • size: 16,856 kB
  • ctags: 6,127
  • sloc: ansic: 66,158; fortran: 4,470; makefile: 1,683; tcl: 414; sh: 69
file content (30 lines) | stat: -rw-r--r-- 404 bytes parent folder | download
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
/* memory.c */


/*
 * malloc/free wrappers to help with debugging.
 */

#include <stdlib.h>
#include <stdio.h>


void *MALLOC( size_t size )
{
   void *p;
   p = malloc( size );
/*
   if (size == 0) {
     printf("MALLOC: size = 0\n");
   }
   printf("MALLOC(%d) = 0x%x\n", size, p );
*/
   return p;
}


void FREE( void *ptr, int id )
{
/*   printf("FREE(0x%x) id=%d\n", ptr, id );*/
   free( ptr );
}