summaryrefslogtreecommitdiff
path: root/src/util/Malloc.c
diff options
context:
space:
mode:
authorlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-03-08 14:50:52 +0000
committerlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-03-08 14:50:52 +0000
commit4fce8ea94f411cf6febcbb9a775991313e96e8f4 (patch)
tree8fb6a0d06c930e304411d5003af111fa738604d0 /src/util/Malloc.c
parent8fef8afb8c8b33c7041b9f5c09c106a36d44f89f (diff)
adding grdocs
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1446 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/Malloc.c')
-rw-r--r--src/util/Malloc.c64
1 files changed, 63 insertions, 1 deletions
diff --git a/src/util/Malloc.c b/src/util/Malloc.c
index 85339e99..5f46383a 100644
--- a/src/util/Malloc.c
+++ b/src/util/Malloc.c
@@ -3,7 +3,8 @@
@date Tue Mar 7 11:58:03 2000
@author Gerd lanfermann
@desc
-
+ Cactus memory allocation routines to monitor memory consumption
+ by C routines. No fortran support.
@enddesc
@version $Header$
@@*/
@@ -41,6 +42,21 @@ static unsigned long int pastmem=0;
********************* External Routines **********************
********************************************************************/
+/*@@
+ @routine CCTKi_Malloc
+ @date Wed Mar 8 12:46:06 2000
+ @author Gerd Lanfermann
+ @desc
+ Allocates memory, updates the total memory variable (static)
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
void *CCTKi_Malloc(size_t size, int line, const char *file)
{
iMemData *memdata;
@@ -67,6 +83,21 @@ void *CCTKi_Malloc(size_t size, int line, const char *file)
return((void*)(data+sizeof(iMemData)));
}
+/*@@
+ @routine CCTKi_Free
+ @date Wed Mar 8 12:46:55 2000
+ @author Gerd Lanfermann
+ @desc
+ Frees memory, updates the total memory variable (static)
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
void CCTKi_Free(void *pointer)
{
iMemData *memdata;
@@ -82,6 +113,22 @@ void CCTKi_Free(void *pointer)
free(memdata);
}
+ /*@@
+ @routine CCTK_MemStat
+ @date Wed Mar 8 12:47:23 2000
+ @author Gerd Lanfermann
+ @desc
+ prints a info string, statign current, past total memory
+ and difference.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
void CCTK_MemStat(void)
{
char mess[138];
@@ -90,6 +137,21 @@ void CCTK_MemStat(void)
printf("CCTK_Memstat: %s ",mess);
}
+ /*@@
+ @routine CCTK_MemStat
+ @date Wed Mar 8 12:47:23 2000
+ @author Gerd Lanfermann
+ @desc
+ returns total memory allocated by C routines
+ (which use CCTK_MALLOC)
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
unsigned long int CCTK_TotalMemory(void)
{
return(totmem);