Changeset b54aa2d in git


Ignore:
Timestamp:
Mar 18, 2009, 7:49:55 PM (14 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
Children:
44959aaf2c6ddbc722d23f97caa1beb1f2d4f88a
Parents:
ca371daac5696a1f6fdcee99b9318e2ed31316d1
Message:
*hannes: static binaries


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

Legend:

Unmodified
Added
Removed
  • kernel/mminit.cc

    rca371d rb54aa2d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mminit.cc,v 1.2 2009-03-17 09:01:46 Singular Exp $ */
     4/* $Id: mminit.cc,v 1.3 2009-03-18 18:49:55 Singular Exp $ */
    55/*
    66* ABSTRACT: init of memory management
     
    3232    exit(1);
    3333  }
     34#if defined(HAVE_STATIC)
     35void* si_malloc(size_t size);
     36#endif
    3437}
    3538
     
    4548    mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc);
    4649#else
     50  #ifdef HAVE_STATIC
     51    mp_set_memory_functions(si_malloc,reallocSize,freeSize);
     52  #else
    4753    mp_set_memory_functions(malloc,reallocSize,freeSize);
     54  #endif
     55
    4856#endif
    4957    om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
  • kernel/mmstd.c

    rca371d rb54aa2d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmstd.c,v 1.5 2009-03-17 09:01:46 Singular Exp $ */
     4/* $Id: mmstd.c,v 1.6 2009-03-18 18:49:55 Singular Exp $ */
    55/*
    66* ABSTRACT: standard version of C-memory management alloc func
     
    1818// on them
    1919// already provided in libomalloc
    20 #if !defined(OMALLOC_USES_MALLOC) && !defined(X_OMALLOC) && !defined(HAVE_STATIC)
     20#if defined(HAVE_STATIC)
     21void* si_malloc(size_t size)
     22{
     23  void* addr;
     24  if (size == 0) size = 1;
     25
     26  omTypeAllocAligned(void*, addr, size);
     27  OM_MARK_AS_STATIC(addr);
     28  return addr;
     29}
     30
     31void freeSize(void* addr, size_t size)
     32{
     33  if (addr) omFreeSize(addr, size);
     34}
     35
     36void* reallocSize(void* old_addr, size_t old_size, size_t new_size)
     37{
     38  if (old_addr && new_size)
     39  {
     40   void* new_addr;
     41    omTypeReallocAlignedSize(old_addr, old_size, void*, new_addr, new_size);
     42    OM_MARK_AS_STATIC(new_addr);
     43    return new_addr;
     44  }
     45  else
     46  {
     47    freeSize(old_addr, old_size);
     48    return si_malloc(new_size);
     49  }
     50}
     51#else
     52#if !defined(OMALLOC_USES_MALLOC) && !defined(X_OMALLOC)
    2153    /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */
    2254    /* sage ticket 5344: http://trac.sagemath.org/sage_trac/ticket/5344 */
     
    4880  }
    4981}
     82
     83#endif
    5084#endif
    5185
Note: See TracChangeset for help on using the changeset viewer.