Changeset 5374da in git
- Timestamp:
- Jun 14, 2011, 3:50:42 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 9189e93eec836e1bd1e7b9961d718cb4ecce03c9
- Parents:
- 1b74f33756e72aff51761ea644ac69f9ea6861ff
- Location:
- Singular
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/misc_ip.cc
r1b74f3 r5374da 1055 1055 const char *singular_date=__DATE__ " " __TIME__; 1056 1056 1057 int mmInit( void );1058 int mmIsInitialized=mmInit();1059 1060 1057 extern "C" 1061 1058 { … … 1070 1067 } 1071 1068 1072 int mmInit( void )1073 {1074 if(mmIsInitialized==0)1075 {1076 1077 #ifndef LIBSINGULAR1078 #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 #else1085 mp_set_memory_functions(malloc,reallocSize,freeSize);1086 #endif1087 #endif // ifndef LIBSINGULAR1088 om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;1089 #ifndef OM_NDEBUG1090 #ifndef __OPTIMIZE__1091 om_Opts.ErrorHook = dErrorBreak;1092 #endif1093 #endif1094 omInitInfo();1095 #ifdef OM_SING_KEEP1096 om_Opts.Keep = OM_SING_KEEP;1097 #endif1098 }1099 mmIsInitialized=1;1100 return 1;1101 }1102 1103 1069 /*2 1104 1070 * initialize components of Singular … … 1107 1073 { 1108 1074 #ifdef HAVE_FACTORY 1075 // factory default settings: ----------------------------------------------- 1109 1076 On(SW_USE_NTL); 1110 1077 Off(SW_USE_GCD_P); … … 1118 1085 On(SW_USE_QGCD); 1119 1086 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.: ----------------------------------------------- 1122 1103 #ifdef INIT_BUG 1123 1104 jjInitTab1(); 1124 1105 #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_FACTORY1134 factoryseed(t);1135 #endif1136 siRandomStart=t;1137 /*4 private data of other modules*/1138 1106 memset(&sLastPrinted,0,sizeof(sleftv)); 1139 1107 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'ed1143 // hack such that all shared' libs in the bindir are loaded correctly1144 feInitResources(name);1145 1108 extern int iiInitArithmetic(); 1146 1109 iiInitArithmetic(); 1147 1148 1110 basePack=(package)omAlloc0(sizeof(*basePack)); 1149 1111 currPack=basePack; … … 1155 1117 basePackHdl=h; 1156 1118 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: -------------------------------------------------- 1157 1136 slStandardInit(); 1158 1137 myynest=0; 1159 1138 1139 // loading standard.lib ----------------------------------------------- 1160 1140 if (! feOptValue(FE_OPT_NO_STDLIB)) 1161 1141 { -
Singular/tesths.cc
r1b74f3 r5374da 36 36 #include <Singular/bbfan.h> 37 37 #include <Singular/pyobject_setup.h> 38 #include <omalloc/omalloc.h> 38 39 39 40 … … 46 47 47 48 #if ! defined(LIBSINGULAR) 49 int 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 48 63 /*0 implementation*/ 49 64 int main( /* main entry to Singular */ … … 51 66 char** argv) /* parameter array */ 52 67 { 68 mmInit(); 53 69 // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed 54 70 omInitRet_2_Info(argv[0]);
Note: See TracChangeset
for help on using the changeset viewer.