Changeset f8dcbcb in git for Singular/mmstd.c


Ignore:
Timestamp:
Jan 27, 2001, 6:04:59 PM (23 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
995ba8e72c52d5e7ce134eb888bb7682e01af581
Parents:
d83977461ed45e8d1baf489f2bd39e88bd603aa3
Message:
windows port


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

Legend:

Unmodified
Added
Removed
  • Singular/mmstd.c

    rd83977 rf8dcbcb  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mmstd.c,v 1.2 2001-01-24 16:54:04 levandov Exp $ */
     4/* $Id: mmstd.c,v 1.3 2001-01-27 17:04:59 obachman Exp $ */
    55/*
    6 * ABSTRACT: standard version of C-memory management alloc func
     6* ABSTRACT: standard version of C-memory management alloc func
     7* i.e. (malloc/realloc/free)
    78*/
    89
    910#include "mod2.h"
    1011
    11 /* We define those, so that our values of
    12    OM_TRACK and OM_CHECK are used  */
     12#define OM_NO_MALLOC_MACROS
     13#include "omalloc.h"
     14
     15// we provide these functions, so that the settings of OM_CHECK
     16// and OM_TRACK are used, but only provide them if omalloc is not based
     17// on them
     18#ifndef OMALLOC_USES_MALLOC
    1319
    1420// define this so that all addr allocated there are marked
    1521// as static, i.e. not metioned by omPrintUsedAddr
    16 #ifndef ix86_Win
    1722#define OM_MALLOC_MARK_AS_STATIC
    1823#include <omalloc.c>
    19 #else
    20 #include <stdlib.h>
    21 void freeSize(void* addr, size_t size)
    22 {
    23   if (addr) free(addr);
    24 }
    25 
    26 void* reallocSize(void* old_addr, size_t old_size, size_t new_size)
    27 {
    28   if (old_addr && new_size)
    29   {
    30    return realloc(old_addr, new_size);
    31   }
    32   else
    33   {
    34     freeSize(old_addr, old_size);
    35     return malloc(new_size);
    36   }
    37 }
    3824#endif
Note: See TracChangeset for help on using the changeset viewer.