scimem.c File Reference

#include "MALLOC.h"
#include "stack-c.h"
#include "scimem.h"
#include "sciprint.h"

Include dependency graph for scimem.c:

Go to the source code of this file.

Functions

integer C2F() scimem (integer *n, integer *ptr)
integer C2F() scigmem (integer *n, integer *ptr)
void C2F() freegmem (void)
void C2F() freemem (void)

Variables

static char * the_p = NULL
static char * the_ps = NULL
static char * the_gp = NULL
static char * the_gps = NULL


Function Documentation

void C2F() freegmem ( void   ) 

Definition at line 69 of file scimem.c.

References NULL, SCISTACKFREE, and the_gps.

Referenced by TerminateCorePart2().

00070 {
00071   if (the_gps != NULL) SCISTACKFREE(the_gps);
00072 }

Here is the caller graph for this function:

void C2F() freemem ( void   ) 

Definition at line 74 of file scimem.c.

References NULL, SCISTACKFREE, and the_ps.

Referenced by TerminateCorePart2().

00075 {
00076   if (the_ps != NULL) SCISTACKFREE(the_ps);
00077 }

Here is the caller graph for this function:

integer C2F() scigmem ( integer n,
integer ptr 
)

Definition at line 42 of file scimem.c.

References C2F, int, n, NULL, sciprint(), SCISTACKMALLOC, the_gp, and the_gps.

Referenced by C2F().

00043 {
00044   register char *p1=NULL;
00045   if (*n > 0)
00046   {
00047     /* add 1 for alignment problems */
00048     p1 = (char *) SCISTACKMALLOC((unsigned)sizeof(double) * (*n + 1));
00049     if (p1 != NULL) 
00050         {
00051                 the_gps = the_gp;
00052                 the_gp = p1;
00053                 /* add 1 for alignment problems */
00054                 *ptr = ((int) (the_gp - (char *)C2F(stack).Stk))/sizeof(double) + 1;
00055     }
00056     else 
00057     {
00058                 if (the_gp == NULL) 
00059                 {
00060                         sciprint("No space to allocate Scilab stack\r\n");
00061                         exit(1); 
00062                 }
00063                 *ptr=0;
00064     }
00065   }
00066   return(0);
00067 }

Here is the call graph for this function:

Here is the caller graph for this function:

integer C2F() scimem ( integer n,
integer ptr 
)

Definition at line 14 of file scimem.c.

References C2F, int, n, NULL, sciprint(), SCISTACKMALLOC, the_p, and the_ps.

Referenced by C2F().

00015 {
00016   register char *p1 = NULL;
00017   if (*n > 0)
00018   {
00019         /* add 1 for alignment problems */
00020     p1 = (char *) SCISTACKMALLOC(((unsigned long) sizeof(double)) * (*n + 1));
00021                   
00022     if (p1 != NULL) 
00023         {
00024                 the_ps = the_p;
00025                 the_p = p1;
00026                 /* add 1 for alignment problems */
00027                 *ptr = ((int) (the_p - (char *)C2F(stack).Stk))/sizeof(double) + 1;
00028     }
00029     else 
00030     {
00031                 if (the_p == NULL) 
00032                 {
00033                         sciprint("No space to allocate Scilab stack\r\n");
00034                         exit(1); 
00035                 }
00036                 *ptr=0;
00037     }
00038   }
00039   return(0);
00040 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char* the_gp = NULL [static]

Definition at line 11 of file scimem.c.

Referenced by scigmem().

char* the_gps = NULL [static]

Definition at line 12 of file scimem.c.

Referenced by freegmem(), and scigmem().

char* the_p = NULL [static]

Definition at line 9 of file scimem.c.

Referenced by scimem().

char* the_ps = NULL [static]

Definition at line 10 of file scimem.c.

Referenced by freemem(), and scimem().


Generated on Sun Mar 4 15:16:33 2007 for Scilab [trunk] by  doxygen 1.5.1