Changeset 5374da in git


Ignore:
Timestamp:
Jun 14, 2011, 3:50:42 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '79dfb9a6d258bfeb991428bdb25b8f55e9e809b2')
Children:
9189e93eec836e1bd1e7b9961d718cb4ecce03c9
Parents:
1b74f33756e72aff51761ea644ac69f9ea6861ff
Message:
libsingular stuff

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

Legend:

Unmodified
Added
Removed
  • Singular/misc_ip.cc

    r1b74f3 r5374da  
    10551055const char *singular_date=__DATE__ " " __TIME__;
    10561056
    1057 int mmInit( void );
    1058 int mmIsInitialized=mmInit();
    1059 
    10601057extern "C"
    10611058{
     
    10701067}
    10711068
    1072 int mmInit( void )
    1073 {
    1074   if(mmIsInitialized==0)
    1075   {
    1076 
    1077 #ifndef LIBSINGULAR
    1078 #if defined(OMALLOC_USES_MALLOC) || defined(X_OMALLOC)
    1079     /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */
    1080     /* sage ticket 5344: http://trac.sagemath.org/sage_trac/ticket/5344 */
    1081 #include <omalloc/omalloc.h>
    1082     /* do not rely on the default in Singular as libsingular may be different */
    1083     mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc);
    1084 #else
    1085     mp_set_memory_functions(malloc,reallocSize,freeSize);
    1086 #endif
    1087 #endif // ifndef LIBSINGULAR
    1088     om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
    1089 #ifndef OM_NDEBUG
    1090 #ifndef __OPTIMIZE__
    1091     om_Opts.ErrorHook = dErrorBreak;
    1092 #endif
    1093 #endif
    1094     omInitInfo();
    1095 #ifdef OM_SING_KEEP
    1096     om_Opts.Keep = OM_SING_KEEP;
    1097 #endif
    1098   }
    1099   mmIsInitialized=1;
    1100   return 1;
    1101 }
    1102 
    11031069/*2
    11041070* initialize components of Singular
     
    11071073{
    11081074#ifdef HAVE_FACTORY
     1075// factory default settings: -----------------------------------------------
    11091076  On(SW_USE_NTL);
    11101077  Off(SW_USE_GCD_P);
     
    11181085  On(SW_USE_QGCD);
    11191086  Off(SW_USE_NTL_SORT); // may be changed by an command line option
    1120 #endif
    1121 
     1087  factoryError=WerrorS;
     1088#endif
     1089
     1090// memory initialization: -----------------------------------------------
     1091    om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
     1092#ifndef OM_NDEBUG
     1093#ifndef __OPTIMIZE__
     1094    om_Opts.ErrorHook = dErrorBreak;
     1095#endif
     1096#endif
     1097    omInitInfo();
     1098#ifdef OM_SING_KEEP
     1099    om_Opts.Keep = OM_SING_KEEP;
     1100#endif
     1101
     1102// interpreter tables etc.: -----------------------------------------------
    11221103#ifdef INIT_BUG
    11231104  jjInitTab1();
    11241105#endif
    1125   /* initialize components */
    1126   factoryError=WerrorS;
    1127 /*4 randomize: */
    1128   int t=initTimer();
    1129   /*t=(int)time(NULL);*/
    1130   if (t==0) t=1;
    1131   initRTimer();
    1132   siSeed=t;
    1133 #ifdef HAVE_FACTORY
    1134   factoryseed(t);
    1135 #endif
    1136   siRandomStart=t;
    1137 /*4 private data of other modules*/
    11381106  memset(&sLastPrinted,0,sizeof(sleftv));
    11391107  sLastPrinted.rtyp=NONE;
    1140   feOptSpec[FE_OPT_RANDOM].value = (void*) ((long)siRandomStart);
    1141 
    1142   // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed
    1143   // hack such that all shared' libs in the bindir are loaded correctly
    1144   feInitResources(name);
    11451108  extern int iiInitArithmetic();
    11461109  iiInitArithmetic();
    1147 
    11481110  basePack=(package)omAlloc0(sizeof(*basePack));
    11491111  currPack=basePack;
     
    11551117  basePackHdl=h;
    11561118
     1119// random generator: -----------------------------------------------
     1120  int t=initTimer();
     1121  if (t==0) t=1;
     1122  initRTimer();
     1123  siSeed=t;
     1124#ifdef HAVE_FACTORY
     1125  factoryseed(t);
     1126#endif
     1127  siRandomStart=t;
     1128  feOptSpec[FE_OPT_RANDOM].value = (void*) ((long)siRandomStart);
     1129
     1130// ressource table: ----------------------------------------------------
     1131  // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed
     1132  // hack such that all shared' libs in the bindir are loaded correctly
     1133  feInitResources(name);
     1134
     1135// singular links: --------------------------------------------------
    11571136  slStandardInit();
    11581137  myynest=0;
    11591138
     1139// loading standard.lib -----------------------------------------------
    11601140  if (! feOptValue(FE_OPT_NO_STDLIB))
    11611141  {
  • Singular/tesths.cc

    r1b74f3 r5374da  
    3636#include <Singular/bbfan.h>
    3737#include <Singular/pyobject_setup.h>
     38#include <omalloc/omalloc.h>
    3839
    3940
     
    4647
    4748#if ! defined(LIBSINGULAR)
     49int mmInit( void )
     50{
     51#if defined(OMALLOC_USES_MALLOC) || defined(X_OMALLOC)
     52    /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */
     53    /* sage ticket 5344: http://trac.sagemath.org/sage_trac/ticket/5344 */
     54    /* do not rely on the default in Singular as libsingular may be different */
     55    mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc);
     56#else
     57    mp_set_memory_functions(malloc,reallocSize,freeSize);
     58#endif
     59  return 1;
     60}
     61
     62
    4863/*0 implementation*/
    4964int main(          /* main entry to Singular */
     
    5166    char** argv)   /* parameter array */
    5267{
     68  mmInit();
    5369  // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed
    5470  omInitRet_2_Info(argv[0]);
Note: See TracChangeset for help on using the changeset viewer.