Changeset 46feb1 in git for Singular/kutil.cc


Ignore:
Timestamp:
Apr 27, 1998, 6:09:37 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
38b2367c696dca8d148e865e1462e98984c9ccab
Parents:
94f4f4606dc2922d461753e53811bf335011bcf5
Message:
* hannes: use ReAlloc for enlargeT, enlargeL  (kutil.cc)


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

Legend:

Unmodified
Added
Removed
  • Singular/kutil.cc

    r94f4f4 r46feb1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.18 1998-04-23 09:52:11 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.19 1998-04-27 16:08:44 Singular Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for std
     
    205205}
    206206
    207 void enlargeT (TSet* T,int* length,int incr)
     207static inline void enlargeT (TSet* T,int* length,int incr)
    208208{
    209209  TSet h;
    210210
    211   h = (TSet)Alloc(((*length)+incr)* sizeof(TObject));
    212   /*for (i=0; i<=(*length)-1; i++) h[i] = (*T)[i];*/
    213   memcpy(h, *T, (*length) * sizeof(TObject));
    214   Free((ADDRESS)*T,((*length)*sizeof(TObject)));
    215   *T = h;
     211  *T = (TSet)ReAlloc((ADDRESS)(*T),(*length)*sizeof(TObject),
     212                                   ((*length)+incr)*sizeof(TObject));
    216213  (*length) += incr;
    217214}
     
    250247}
    251248
    252 void enlargeL (LSet* L,int* length,int incr)
     249static inline void enlargeL (LSet* L,int* length,int incr)
    253250{
    254251  LSet h;
    255252
    256   h = (LSet)Alloc(((*length)+incr)*sizeof(LObject));
    257   /*for (i=0; i<(*length); i++) h[i] = (*L)[i];*/
    258   memcpy(h, *L, (*length) * sizeof(LObject));
    259   Free((ADDRESS)*L,((*length)*sizeof(LObject)));
    260   *L = h;
     253  *L = (LSet)ReAlloc((ADDRESS)(*L),(*length)*sizeof(LObject),
     254                                   ((*length)+incr)*sizeof(LObject));
    261255  (*length) += incr;
    262256}
Note: See TracChangeset for help on using the changeset viewer.