Changeset 9f82971 in git for Singular/misc_ip.cc


Ignore:
Timestamp:
Nov 5, 2010, 12:02:15 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
088214122d919b931fc5e2a3bda1528332aedcc0
Parents:
ce2fa9e3304caaa51b9f2278ca19da5ae34105d0
Message:
init stuff moved to misc_ip.cc

git-svn-id: file:///usr/local/Singular/svn/trunk@13602 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/misc_ip.cc

    rce2fa9 r9f82971  
    10741074}
    10751075}
     1076
     1077const char *singular_date=__DATE__ " " __TIME__;
     1078
     1079int mmInit( void );
     1080int mmIsInitialized=mmInit();
     1081
     1082extern "C"
     1083{
     1084  void omSingOutOfMemoryFunc()
     1085  {
     1086    fprintf(stderr, "\nSingular error: no more memory\n");
     1087    omPrintStats(stderr);
     1088    m2_end(14);
     1089    /* should never get here */
     1090    exit(1);
     1091  }
     1092}
     1093
     1094int mmInit( void )
     1095{
     1096  if(mmIsInitialized==0)
     1097  {
     1098
     1099#ifndef LIBSINGULAR
     1100#if defined(OMALLOC_USES_MALLOC) || defined(X_OMALLOC)
     1101    /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */
     1102    /* sage ticket 5344: http://trac.sagemath.org/sage_trac/ticket/5344 */
     1103#include <omalloc/omalloc.h>
     1104    /* do not rely on the default in Singular as libsingular may be different */
     1105    mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc);
     1106#else
     1107    mp_set_memory_functions(malloc,reallocSize,freeSize);
     1108#endif
     1109#endif // ifndef LIBSINGULAR
     1110    om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
     1111#ifndef OM_NDEBUG
     1112#ifndef __OPTIMIZE__
     1113    om_Opts.ErrorHook = dErrorBreak;
     1114#endif
     1115#endif
     1116    omInitInfo();
     1117#ifdef OM_SING_KEEP
     1118    om_Opts.Keep = OM_SING_KEEP;
     1119#endif
     1120  }
     1121  mmIsInitialized=1;
     1122  return 1;
     1123}
     1124
     1125#ifdef LIBSINGULAR
     1126int siInit(char *name)
     1127{
     1128  // hack such that all shared' libs in the bindir are loaded correctly
     1129  feInitResources(name);
     1130  iiInitArithmetic();
     1131
     1132#if 0
     1133  SingularBuilder::Ptr SingularInstance = SingularBuilder::instance();
     1134#else
     1135  basePack=(package)omAlloc0(sizeof(*basePack));
     1136  currPack=basePack;
     1137  idhdl h;
     1138  h=enterid("Top", 0, PACKAGE_CMD, &IDROOT, TRUE);
     1139  IDPACKAGE(h)->language = LANG_TOP;
     1140  IDPACKAGE(h)=basePack;
     1141  currPackHdl=h;
     1142  basePackHdl=h;
     1143
     1144  slStandardInit();
     1145  myynest=0;
     1146#endif
     1147  if (! feOptValue(FE_OPT_NO_STDLIB))
     1148  {
     1149    int vv=verbose;
     1150    verbose &= ~Sy_bit(V_LOAD_LIB);
     1151    iiLibCmd(omStrDup("standard.lib"), TRUE,TRUE,TRUE);
     1152    verbose=vv;
     1153  }
     1154  errorreported = 0;
     1155}
     1156#endif
     1157
Note: See TracChangeset for help on using the changeset viewer.