Changeset a36f9e8 in git


Ignore:
Timestamp:
Jul 28, 2009, 5:22:04 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
1305eacb0ae9e37f13cfc9e1a6df9828bff15c3b
Parents:
4f673c00a1e6542d18d704394190f2ac7b88173f
Message:
*hannes: mminit->tesths.cc


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

Legend:

Unmodified
Added
Removed
  • Singular/tesths.cc

    r4f673c ra36f9e8  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: tesths.cc,v 1.117 2009-07-28 14:59:52 Singular Exp $ */
     4/* $Id: tesths.cc,v 1.118 2009-07-28 15:22:04 Singular Exp $ */
    55
    66/*
     
    4040const char *singular_date=__DATE__ " " __TIME__;
    4141
     42#include <si_gmp.h>
     43
     44int mmInit( void );
     45int mmIsInitialized=mmInit();
     46
     47extern "C"
     48{
     49  void omSingOutOfMemoryFunc()
     50  {
     51    fprintf(stderr, "\nerror: no more memory\n");
     52    omPrintStats(stderr);
     53    m2_end(14);
     54    /* should never get here */
     55    exit(1);
     56  }
     57}
     58
     59int mmInit( void )
     60{
     61  if(mmIsInitialized==0)
     62  {
     63
     64#ifndef LIBSINGULAR
     65#if defined(OMALLOC_USES_MALLOC) || defined(X_OMALLOC)
     66    /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */
     67    /* sage ticket 5344: http://trac.sagemath.org/sage_trac/ticket/5344 */
     68    /* solution: correctly check OMALLOC_USES_MALLOC from omalloc.h, */
     69    /* do not rely on the default in Singular as libsingular may be different */
     70    mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc);
     71#else
     72    mp_set_memory_functions(malloc,reallocSize,freeSize);
     73#endif
     74#endif // ifndef LIBSINGULAR
     75    om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
     76#ifndef OM_NDEBUG
     77    om_Opts.ErrorHook = dErrorBreak;
     78#endif
     79    omInitInfo();
     80#ifdef OM_SING_KEEP
     81    om_Opts.Keep = OM_SING_KEEP;
     82#endif
     83  }
     84  mmIsInitialized=1;
     85  return 1;
     86}
     87
    4288#ifdef LIBSINGULAR
    4389int siInit(char *name)
Note: See TracChangeset for help on using the changeset viewer.