Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

memory.c File Reference

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

Go to the source code of this file.


Functions

char * MemAlloc (size_t size)
void MemFree (char *ptr, long bytes)
void PrintMaxMemory (void)

Variables

long totalMemory = 0
long maxMemory = 0

Function Documentation

char* MemAlloc size_t    size
 

Definition at line 63 of file memory.c.

References malloc, maxMemory, and totalMemory.

00064 {
00065     totalMemory += (long)size;
00066     if ( totalMemory > maxMemory )
00067     {
00068         maxMemory = totalMemory;
00069     }
00070 
00071     return malloc(size);
00072 }

void MemFree char *    ptr,
long    bytes
 

Definition at line 74 of file memory.c.

References free, and totalMemory.

00075 {
00076     totalMemory -= bytes;
00077     free(ptr);
00078 }

void PrintMaxMemory void   
 

Definition at line 80 of file memory.c.

References maxMemory.

00081 {
00082     fprintf(stdout, "MMMMM-----MAX MEMORY-----MMMMM = %ld\n", maxMemory);
00083 }

Variable Documentation

long maxMemory = 0
 

Definition at line 60 of file memory.c.

Referenced by MemAlloc(), and PrintMaxMemory().

long totalMemory = 0
 

Definition at line 59 of file memory.c.

Referenced by MemAlloc(), and MemFree().

 

Powered by Plone

This site conforms to the following standards: