Changeset 71b3e0 in git for MP/MP


Ignore:
Timestamp:
Oct 14, 1998, 3:34:04 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
6a7528729789dfcc28e43e9a7ba6d072c986c7d7
Parents:
8b4670dada34587a5623038b51515950afe93e51
Message:
1998-10-14  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	    * MP_PariBigInt.[c,h]: Added memory management functions for Pari
	        Bigints

		* MPT_ApNumber.c: MPT_DeleteApInt, MPT_InitCpyApInt is
	        determined
		w.r.t. MP_DEFAULT_APINT_FORMAT and extended to
		MP_DEFAULT_APINT_FORMAT == MP_PARI


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

Legend:

Unmodified
Added
Removed
  • MP/MP/ChangeLog

    r8b4670d r71b3e0  
    111998-10-14  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
     2
     3        * MP_PariBigInt.[c,h]: Added memory management functions for Pari
     4        Bigints
    25
    36        * MP_TcpTransp.c: added MP_KillLink, -MPrsh option to MP_OpenLink
  • MP/MP/MP.h

    r8b4670d r71b3e0  
    16511651                                              char *buffer));
    16521652EXTERN long IMP_PariBigIntAsciiSize _ANSI_ARGS_((MP_ApInt_t mp_number));
     1653
     1654/* Memory mamagment for Pari BigInts:
     1655   By default, the following functions are simple cgeti and empty;
     1656   You can reset this at run-time to whatever fits your needs
     1657*/
     1658EXTERN GEN (*IMP_AllocCgeti) _ANSI_ARGS_((long));
     1659EXTERN void (*IMP_FreeCgeti) _ANSI_ARGS_((GEN));
    16531660
    16541661#ifdef HAVE_GMP_PARI_CONVERSIONS
  • MP/MP/MP_PariBigInt.c

    r8b4670d r71b3e0  
    3232#endif
    3333
     34/**************************************************************************
     35 *
     36 * Memory management routines
     37 *
     38 *************************************************************************/
     39
     40/* By default, simply use cgeti, on alloc */
     41GEN IMP_DefaultAllocCgeti(long l)
     42{
     43  return cgeti(l);
     44}
     45/* and, do nothing on free */
     46void IMP_DefaultFreeCgeti(GEN number)
     47{}
     48/* However, you might also use IMP_RawMemAlloc */
     49GEN IMP_RawMemAllocCgeti(long length)
     50{
     51  GEN z = (GEN) IMP_RawMemAllocFnc( ((ulong)length)<<TWOPOTBYTES_IN_LONG );
     52  z[0]=evaltyp(1)+evalpere(1)+evallg(length);
     53  return( z );
     54}
     55void IMP_RawMemFreeCgeti(GEN number)
     56{
     57  IMP_RawMemFreeFnc(number);
     58}
     59
     60GEN (*IMP_AllocCgeti)(long) = IMP_DefaultAllocCgeti;
     61void (*IMP_FreeCgeti)(GEN) = IMP_DefaultFreeCgeti;
     62
     63/**************************************************************************
     64 *
     65 * Put/Get
     66 *
     67 *************************************************************************/
     68
    3469MP_Status_t IMP_PutPariBigInt(MP_Link_pt link, MP_ApInt_t mp_number)
    3570{
     
    81116
    82117  /* Initialize the number */
    83   number = cgeti(length+2);
     118  number = IMP_AllocCgeti(length+2);
    84119  setlgef(number, length+2);
    85120  setsigne(number, sign);
     
    164199  if (length < 0 ) length = -length;
    165200
    166   pnum = cgeti(length + 2);
     201  pnum = IMP_AllocCgeti(length + 2);
    167202  setlgef(pnum, length + 2);
    168203  setsigne(pnum, sign);
  • MP/MP/h/MP_PariBigInt.h

    r8b4670d r71b3e0  
    3434EXTERN long IMP_PariBigIntAsciiSize _ANSI_ARGS_((MP_ApInt_t mp_number));
    3535
     36/* Memory mamagment for Pari BigInts:
     37   By default, the following functions are simple cgeti and empty;
     38   You can reset this at run-time to whatever fits your needs
     39*/
     40EXTERN GEN (*IMP_AllocCgeti) _ANSI_ARGS_((long));
     41EXTERN void (*IMP_FreeCgeti) _ANSI_ARGS_((GEN));
     42
    3643#ifdef HAVE_GMP_PARI_CONVERSIONS
    3744#include "gmp.h"
Note: See TracChangeset for help on using the changeset viewer.