get rid of IntArrays and FloatArray code.
include holes when calculating memory usage. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1640 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
79
H/TermExt.h
79
H/TermExt.h
@@ -10,7 +10,7 @@
|
||||
* File: TermExt.h *
|
||||
* mods: *
|
||||
* comments: Extensions to standard terms for YAP *
|
||||
* version: $Id: TermExt.h,v 1.8 2006-05-19 13:48:11 vsc Exp $ *
|
||||
* version: $Id: TermExt.h,v 1.9 2006-05-19 14:31:32 vsc Exp $ *
|
||||
*************************************************************************/
|
||||
|
||||
#ifdef USE_SYSTEM_MALLOC
|
||||
@@ -45,33 +45,27 @@ typedef enum
|
||||
{
|
||||
#if defined(IN_SECOND_QUADRANT) && !GC_NO_TAGS
|
||||
db_ref_e = sizeof (Functor *) | RBIT,
|
||||
int_array_e = 2 * sizeof (Functor *) | RBIT,
|
||||
double_array_e = 3 * sizeof (Functor *) | RBIT,
|
||||
long_int_e = 4 * sizeof (Functor *) | RBIT,
|
||||
long_int_e = 2 * sizeof (Functor *) | RBIT,
|
||||
#ifdef USE_GMP
|
||||
big_int_e = 5 * sizeof (Functor *) | RBIT,
|
||||
double_e = 6 * sizeof (Functor *) | RBIT
|
||||
big_int_e = 3 * sizeof (Functor *) | RBIT,
|
||||
double_e = 4 * sizeof (Functor *) | RBIT
|
||||
#else
|
||||
double_e = 5 * sizeof (Functor *) | RBIT
|
||||
double_e = 3 * sizeof (Functor *) | RBIT
|
||||
#endif
|
||||
#else
|
||||
db_ref_e = sizeof (Functor *),
|
||||
int_array_e = 2 * sizeof (Functor *),
|
||||
double_array_e = 3 * sizeof (Functor *),
|
||||
long_int_e = 4 * sizeof (Functor *),
|
||||
long_int_e = 2 * sizeof (Functor *),
|
||||
#ifdef USE_GMP
|
||||
big_int_e = 5 * sizeof (Functor *),
|
||||
double_e = 6 * sizeof (Functor *)
|
||||
big_int_e = 3 * sizeof (Functor *),
|
||||
double_e = 4 * sizeof (Functor *)
|
||||
#else
|
||||
double_e = 5 * sizeof (Functor *)
|
||||
double_e = 3 * sizeof (Functor *)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
blob_type;
|
||||
|
||||
#define FunctorDBRef ((Functor)(db_ref_e))
|
||||
#define FunctorIntArray ((Functor)(int_array_e))
|
||||
#define FunctorDoubleArray ((Functor)(double_array_e))
|
||||
#define FunctorLongInt ((Functor)(long_int_e))
|
||||
#ifdef USE_GMP
|
||||
#define FunctorBigInt ((Functor)(big_int_e))
|
||||
@@ -326,59 +320,6 @@ IsLongIntTerm (Term t)
|
||||
}
|
||||
|
||||
|
||||
Term Yap_MkIntArrayTerm (UInt, Int *);
|
||||
|
||||
inline EXTERN Int *Yap_IntArrayOfTerm (Term t);
|
||||
|
||||
inline EXTERN Int *
|
||||
Yap_IntArrayOfTerm (Term t)
|
||||
{
|
||||
return (Int *) (RepAppl(t)+2);
|
||||
}
|
||||
|
||||
inline EXTERN UInt Yap_SizeOfIntArray (Term t);
|
||||
|
||||
inline EXTERN UInt
|
||||
Yap_SizeOfIntArray (Term t)
|
||||
{
|
||||
return (UInt) (RepAppl(t)[1]);
|
||||
}
|
||||
|
||||
inline EXTERN int Yap_IsIntArrayTerm (Term);
|
||||
|
||||
inline EXTERN int
|
||||
Yap_IsIntArrayTerm (Term t)
|
||||
{
|
||||
return (int) (IsApplTerm (t) && FunctorOfTerm (t) == FunctorIntArray);
|
||||
}
|
||||
|
||||
|
||||
Term Yap_MkFloatArrayTerm (UInt, Float *);
|
||||
|
||||
inline EXTERN Float *Yap_FloatArrayOfTerm (Term t);
|
||||
|
||||
inline EXTERN Float *
|
||||
Yap_FloatArrayOfTerm (Term t)
|
||||
{
|
||||
return (Float *) (RepAppl(t)+2);
|
||||
}
|
||||
|
||||
inline EXTERN UInt Yap_SizeOfFloatArray (Term t);
|
||||
|
||||
inline EXTERN UInt
|
||||
Yap_SizeOfFloatArray (Term t)
|
||||
{
|
||||
return (UInt) (RepAppl(t)[1]);
|
||||
}
|
||||
|
||||
inline EXTERN int Yap_IsFloatArrayTerm (Term);
|
||||
|
||||
inline EXTERN int
|
||||
Yap_IsFloatArrayTerm (Term t)
|
||||
{
|
||||
return (int) (IsApplTerm (t) && FunctorOfTerm (t) == FunctorDoubleArray);
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_GMP
|
||||
#include <stdio.h>
|
||||
@@ -607,8 +548,6 @@ unify_extension (Functor f, CELL d0, CELL * pt0, CELL d1)
|
||||
switch (BlobOfFunctor (f))
|
||||
{
|
||||
case db_ref_e:
|
||||
case int_array_e:
|
||||
case double_array_e:
|
||||
return (d0 == d1);
|
||||
case long_int_e:
|
||||
return (pt0[1] == RepAppl (d1)[1]);
|
||||
|
||||
Reference in New Issue
Block a user