Changeset ba6f0c in git for omalloc/omAlloc.c


Ignore:
Timestamp:
Nov 26, 1999, 6:57:54 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
1cbba61f1dd6a40e718cf26b45cf9ec15a0f849f
Parents:
a89a22ce7744ac91b8406062c921c8beb8c652a0
Message:
as we go along


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

Legend:

Unmodified
Added
Removed
  • omalloc/omAlloc.c

    ra89a22c rba6f0c  
    44 *  Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
    55 *  Created: 11/99
    6  *  Version: $Id: omAlloc.c,v 1.3 1999-11-23 20:40:12 obachman Exp $
     6 *  Version: $Id: omAlloc.c,v 1.4 1999-11-26 17:57:51 obachman Exp $
    77 *******************************************************************/
    88#ifndef OM_ALLOC_C
     
    7070{
    7171  void* new_addr;
    72   int __om_fill = new_size - old_size;
     72  int _om_fill = new_size - old_size;
    7373  new_addr = _omReallocBlock(void*, new_addr, new_size, old_addr, old_size);
    74   if (_om_fill > 0) memset(((void*) new_addr) + __om_fill, 0, __om_fill);
     74  if (_om_fill > 0) memset(new_addr + _om_fill, 0, _om_fill);
    7575  return new_addr;
    7676}
     
    111111{
    112112  void* new_addr;
    113   int __om_fill = new_size - old_size;
     113  int om_fill = new_size - old_size;
    114114  __omTypeReallocAlignedBlock(void*, new_addr, new_size, old_addr, old_size);
    115   if (_om_fill > 0) memset(((void*) new_addr) + __om_fill, 0, __om_fill);
     115  if (om_fill > 0) memset(new_addr + om_fill, 0, om_fill);
    116116  return new_addr;
    117117}
     
    226226#endif /* OM_ALIGNMENT_NEEDS_WORK */
    227227
     228/*******************************************************************
     229 * 
     230 *  Definition of Func
     231 * 
     232 *******************************************************************/
     233
     234#define ALLOCBIN_FUNC_WRAPPER(func)             \
     235void* omFunc##func (omBin bin)                  \
     236{                                               \
     237  void* addr;                                   \
     238  __omType##func (void*, addr, bin);            \
     239  return addr;                                  \
     240}
     241
     242#define ALLOCSIZE_FUNC_WRAPPER(func)            \
     243void* omFunc##func (size_t size)                \
     244{                                               \
     245  void* addr;                                   \
     246  __omType##func (void*, addr, size);           \
     247  return addr;                                  \
     248}
     249
     250#define FREE_FUNC_WRAPPER(func)                 \
     251void omFunc##func (void* addr)                  \
     252{                                               \
     253  __om##func (addr);                            \
     254}
     255
     256#define FREEBLOCK_FUNC_WRAPPER(func)            \
     257void omFunc##func (void* addr, size_t size)     \
     258{                                               \
     259  __om##func (addr, size);                      \
     260}
     261
     262ALLOCBIN_FUNC_WRAPPER(AllocBin)
     263ALLOCBIN_FUNC_WRAPPER(Alloc0Bin)
     264FREE_FUNC_WRAPPER(FreeBin)
     265ALLOCSIZE_FUNC_WRAPPER(AllocBlock)
     266ALLOCSIZE_FUNC_WRAPPER(Alloc0Block)
     267FREEBLOCK_FUNC_WRAPPER(FreeBlock)
     268ALLOCSIZE_FUNC_WRAPPER(AllocChunk)
     269ALLOCSIZE_FUNC_WRAPPER(Alloc0Chunk)
     270FREE_FUNC_WRAPPER(FreeChunk)
     271
     272#ifdef OM_ALIGNMENT_NEEDS_WORK
     273ALLOCSIZE_FUNC_WRAPPER(AllocAlignedBlock)
     274ALLOCSIZE_FUNC_WRAPPER(Alloc0AlignedBlock)
     275ALLOCSIZE_FUNC_WRAPPER(AllocAlignedChunk)
     276ALLOCSIZE_FUNC_WRAPPER(Alloc0AlignedChunk)
     277FREE_FUNC_WRAPPER(FreeAlignedChunk)
     278#endif
    228279
    229280/*******************************************************************
Note: See TracChangeset for help on using the changeset viewer.