Changeset 5f6d137 in git


Ignore:
Timestamp:
Mar 19, 2009, 11:34:00 AM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
2e5f59996ea62adb5223bd59681c6fe2d5fcfa86
Parents:
f9d9013b894bb374c9ef74f2cfecb1689aa109b9
Message:
*hannes: static binaries and malloc


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

Legend:

Unmodified
Added
Removed
  • kernel/mminit.cc

    rf9d901 r5f6d137  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mminit.cc,v 1.3 2009-03-18 18:49:55 Singular Exp $ */
     4/* $Id: mminit.cc,v 1.4 2009-03-19 10:34:00 Singular Exp $ */
    55/*
    66* ABSTRACT: init of memory management
     
    3232    exit(1);
    3333  }
    34 #if defined(HAVE_STATIC)
    35 void* si_malloc(size_t size);
    36 #endif
    3734}
    3835
     
    4845    mp_set_memory_functions(omMallocFunc,omReallocSizeFunc,omFreeSizeFunc);
    4946#else
    50   #ifdef HAVE_STATIC
    51     mp_set_memory_functions(si_malloc,reallocSize,freeSize);
    52   #else
    5347    mp_set_memory_functions(malloc,reallocSize,freeSize);
    54   #endif
    55 
    5648#endif
    5749    om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
  • kernel/mmstd.c

    rf9d901 r5f6d137  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmstd.c,v 1.7 2009-03-18 18:53:28 Singular Exp $ */
     4/* $Id: mmstd.c,v 1.8 2009-03-19 10:34:00 Singular Exp $ */
    55/*
    66* ABSTRACT: standard version of C-memory management alloc func
     
    1818// on them
    1919// already provided in libomalloc
    20 #if defined(HAVE_STATIC)
    21 void* si_malloc(size_t size)
    22 {
    23   void* addr;
    24   if (size == 0) size = 1;
    25 
    26   omTypeAllocAligned(void*, addr, size);
    27   return addr;
    28 }
    29 
    30 void freeSize(void* addr, size_t size)
    31 {
    32   if (addr) omFreeSize(addr, size);
    33 }
    34 
    35 void* reallocSize(void* old_addr, size_t old_size, size_t new_size)
    36 {
    37   if (old_addr && new_size)
    38   {
    39    void* new_addr;
    40     omTypeReallocAlignedSize(old_addr, old_size, void*, new_addr, new_size);
    41     return new_addr;
    42   }
    43   else
    44   {
    45     freeSize(old_addr, old_size);
    46     return si_malloc(new_size);
    47   }
    48 }
    49 #else
    5020#if !defined(OMALLOC_USES_MALLOC) && !defined(X_OMALLOC)
    5121    /* in mmstd.c, for some architectures freeSize() unconditionally uses the *system* free() */
     
    8050
    8151#endif
    82 #endif
    8352
Note: See TracChangeset for help on using the changeset viewer.