Changeset f3d535 in git


Ignore:
Timestamp:
Apr 24, 1997, 8:01:30 PM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b21a664aa22dc6e196223af8a74ad4885e83547c')
Children:
40edb034ca387eb23ce7e5316dae62e764557712
Parents:
56f7c59395cec760c41b7311172e225a5cc099eb
Message:
* hannes: simplified initalisation: now only needed for gmp-alloc routines


git-svn-id: file:///usr/local/Singular/svn/trunk@188 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/febase.cc

    r56f7c5 rf3d535  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.6 1997-04-02 15:06:58 Singular Exp $ */
     4/* $Id: febase.cc,v 1.7 1997-04-24 18:01:30 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system, handling of 'voices'
     
    6767#define INITIAL_PRINT_BUFFER 24*1024
    6868static int feBufferLength=INITIAL_PRINT_BUFFER;
    69 static char * feBuffer;
     69static char * feBuffer=(char *)Alloc(INITIAL_PRINT_BUFFER);
    7070
    7171#define START_LEVMAX 32
     
    584584  yylineno = 1;
    585585  currentVoice = &FileAttribs[0];
    586   feBuffer = (char *)Alloc(INITIAL_PRINT_BUFFER);
    587 }
    588 
    589 char * feBufferStart;
     586}
     587
     588static char * feBufferStart;
    590589  /* only used in StringSet(S)/StringAppend(S)*/
    591590char * StringAppend(char *fmt, ...)
  • Singular/mminit.cc

    r56f7c5 rf3d535  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mminit.cc,v 1.4 1997-04-08 16:49:24 Singular Exp $ */
     4/* $Id: mminit.cc,v 1.5 1997-04-24 18:01:30 Singular Exp $ */
    55/*
    66* ABSTRACT: init of memory management
     
    3838  NULL,NULL,NULL,NULL,
    3939  NULL,NULL};
    40 ;
     40#ifdef MM_STAT
     41int mm_active[MAXLIST+1]=
     42{ 0,0,0,0,
     43  0,0,0,0,
     44  0,0,0,0,
     45  0,0,0,0,
     46  0,0,0};
     47int mm_max[MAXLIST+2]=
     48{ 0,0,0,0,
     49  0,0,0,0,
     50  0,0,0,0,
     51  0,0,0,0,
     52  0,0,0,0};
     53#endif
    4154#else
    4255mcb mm_normList[MAXLIST]=
     
    5467  NULL,NULL,NULL,NULL,
    5568  NULL,NULL};
     69#ifdef MM_STAT
     70int mm_active[MAXLIST+1]=
     71{ 0,0,0,0,
     72  0,0,0,
     73  0,0,0,0,
     74  0,0,0,0,
     75  0,0,0,0,
     76  0,0,0};
     77int mm_max[MAXLIST+2]=
     78{ 0,0,0,0,
     79  0,0,0,
     80  0,0,0,0,
     81  0,0,0,0,
     82  0,0,0,0,
     83  0,0,0,0};
    5684#endif
     85#endif
     86
    5787
    5888mcb *mm_theList=mm_normList;
     
    6797#ifdef MDEBUG
    6898
    69 DBMCB mm_theDBused;
    70 DBMCB mm_theDBfree;
    71 DBMCB mm_tmpDBused;
    72 DBMCB mm_tmpDBfree;
    73 DBMCB mm_normDBused;
    74 DBMCB mm_normDBfree;
     99DBMCB mm_theDBused={NULL,NULL,0,0,NULL,0,0,NULL};
     100DBMCB mm_theDBfree={NULL,NULL,0,0,NULL,0,0,NULL};
     101DBMCB mm_tmpDBused={NULL,NULL,0,0,NULL,0,0,NULL};
     102DBMCB mm_tmpDBfree={NULL,NULL,0,0,NULL,0,0,NULL};
     103DBMCB mm_normDBused={NULL,NULL,0,0,NULL,0,0,NULL};
     104DBMCB mm_normDBfree={NULL,NULL,0,0,NULL,0,0,NULL};
    75105void * mm_maxAddr=NULL;
    76106void * mm_minAddr=NULL;
     
    134164int mmInit( void )
    135165{
    136   int ii;
    137 #ifdef MM_STAT
    138   for(ii=0; ii<=MAXLIST; ii++)
     166#ifdef HAVE_GMP
     167  if(mmIsInitialized==0)
    139168  {
    140     mm_active[ii]=0; mm_max[ii]=0;
     169#ifndef MDEBUG
     170    mp_set_memory_functions(mmAllocBlock,mmReallocBlock,mmFreeBlock);
     171#else
     172    mp_set_memory_functions(mgAllocBlock,mgReallocBlock,mgFreeBlock);
     173#endif
    141174  }
    142   mm_max[MAXLIST+1]=0;
    143 #endif
    144 #ifdef MDEBUG
    145   if ( ! mmIsInitialized ) {
    146     memset(&mm_theDBused,0,sizeof(mm_theDBused));
    147     memset(&mm_theDBfree,0,sizeof(mm_theDBfree));
    148     memset(&mm_tmpDBused,0,sizeof(mm_tmpDBused));
    149     memset(&mm_tmpDBfree,0,sizeof(mm_tmpDBfree));
    150     memset(&mm_normDBused,0,sizeof(mm_normDBused));
    151     memset(&mm_normDBfree,0,sizeof(mm_normDBfree));
    152     mmIsInitialized=1;
    153   }
    154 #endif /* MDEBUG */
    155 #ifdef HAVE_GMP
    156 #ifndef MDEBUG
    157   mp_set_memory_functions(mmAllocBlock,mmReallocBlock,mmFreeBlock);
    158 #else
    159   mp_set_memory_functions(mgAllocBlock,mgReallocBlock,mgFreeBlock);
    160 #endif
    161175#endif
    162176  return 1;
Note: See TracChangeset for help on using the changeset viewer.