From e4275b636103422ec8eb2e1996dd7923e8c4f909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U-WIN-U2045GN0RNQ=5CV=C3=ADtor=20Santos=20Costa?= Date: Tue, 8 Mar 2011 00:22:32 +0000 Subject: [PATCH] first support for restoring blobs. --- C/agc.c | 1 + H/rheap.h | 9 +++++++++ H/sshift.h | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/C/agc.c b/C/agc.c index 1f233640c..c1cd117e6 100755 --- a/C/agc.c +++ b/C/agc.c @@ -127,6 +127,7 @@ AtomAdjust(Atom a) #define REINIT_LOCK(P) #define REINIT_RWLOCK(P) +#define BlobTypeAdjust(P) (P) #define NoAGCAtomAdjust(P) (P) #define OrArgAdjust(P) #define TabEntryAdjust(P) diff --git a/H/rheap.h b/H/rheap.h index adbfc44c1..4ada62ac5 100755 --- a/H/rheap.h +++ b/H/rheap.h @@ -1574,6 +1574,15 @@ RestoreEntries(PropEntry *pp, int int_key USES_REGS) pp->NextOfPE = PropAdjust(pp->NextOfPE); break; + case BlobProperty: + pp->NextOfPE = + PropAdjust(pp->NextOfPE); + { + BlobPropEntry *bpe = (BlobPropEntry *)pp; + bpe->blob_t = + BlobTypeAdjust(bpe->blob_t); + } + break; default: /* OOPS */ Yap_Error(SYSTEM_ERROR, TermNil, diff --git a/H/sshift.h b/H/sshift.h index 64a0ab831..51bfaf5f5 100755 --- a/H/sshift.h +++ b/H/sshift.h @@ -100,6 +100,7 @@ #define OpRTableAdjust(P) OpRTableAdjust__(P PASS_REGS) #define OpEntryAdjust(P) OpEntryAdjust__(P PASS_REGS) #define PropAdjust(P) PropAdjust__(P PASS_REGS) +#define BlobTypeAdjust(P) BlobTypeAdjust__(P PASS_REGS) #define TrailAddrAdjust(P) TrailAddrAdjust__(P PASS_REGS) #define XAdjust(P) XAdjust__(P PASS_REGS) #define YAdjust(P) YAdjust__(P PASS_REGS) @@ -441,7 +442,6 @@ PropAdjust__ (Prop p USES_REGS) return (Prop) ((p)); } - #else inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE); @@ -473,6 +473,14 @@ PropAdjust__ (Prop p USES_REGS) #endif +inline EXTERN struct PL_blob_t *BlobTypeAdjust__ (struct PL_blob_t *CACHE_TYPE); + +inline EXTERN struct PL_blob_t * +BlobTypeAdjust__ (struct PL_blob_t *at USES_REGS) +{ + return (struct PL_blob_t *) ((at == NULL ? (at) : (struct PL_blob_t *) (CharP (at) + HDiff))); +} + inline EXTERN PredEntry *PredEntryAdjust__ (PredEntry * CACHE_TYPE); inline EXTERN PredEntry *