first support for restoring blobs.

This commit is contained in:
U-WIN-U2045GN0RNQ\Vítor Santos Costa 2011-03-08 00:22:32 +00:00
parent cfc806500d
commit e4275b6361
3 changed files with 19 additions and 1 deletions

View File

@ -127,6 +127,7 @@ AtomAdjust(Atom a)
#define REINIT_LOCK(P) #define REINIT_LOCK(P)
#define REINIT_RWLOCK(P) #define REINIT_RWLOCK(P)
#define BlobTypeAdjust(P) (P)
#define NoAGCAtomAdjust(P) (P) #define NoAGCAtomAdjust(P) (P)
#define OrArgAdjust(P) #define OrArgAdjust(P)
#define TabEntryAdjust(P) #define TabEntryAdjust(P)

View File

@ -1574,6 +1574,15 @@ RestoreEntries(PropEntry *pp, int int_key USES_REGS)
pp->NextOfPE = pp->NextOfPE =
PropAdjust(pp->NextOfPE); PropAdjust(pp->NextOfPE);
break; break;
case BlobProperty:
pp->NextOfPE =
PropAdjust(pp->NextOfPE);
{
BlobPropEntry *bpe = (BlobPropEntry *)pp;
bpe->blob_t =
BlobTypeAdjust(bpe->blob_t);
}
break;
default: default:
/* OOPS */ /* OOPS */
Yap_Error(SYSTEM_ERROR, TermNil, Yap_Error(SYSTEM_ERROR, TermNil,

View File

@ -100,6 +100,7 @@
#define OpRTableAdjust(P) OpRTableAdjust__(P PASS_REGS) #define OpRTableAdjust(P) OpRTableAdjust__(P PASS_REGS)
#define OpEntryAdjust(P) OpEntryAdjust__(P PASS_REGS) #define OpEntryAdjust(P) OpEntryAdjust__(P PASS_REGS)
#define PropAdjust(P) PropAdjust__(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 TrailAddrAdjust(P) TrailAddrAdjust__(P PASS_REGS)
#define XAdjust(P) XAdjust__(P PASS_REGS) #define XAdjust(P) XAdjust__(P PASS_REGS)
#define YAdjust(P) YAdjust__(P PASS_REGS) #define YAdjust(P) YAdjust__(P PASS_REGS)
@ -441,7 +442,6 @@ PropAdjust__ (Prop p USES_REGS)
return (Prop) ((p)); return (Prop) ((p));
} }
#else #else
inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE); inline EXTERN Atom AtomAdjust__ (Atom CACHE_TYPE);
@ -473,6 +473,14 @@ PropAdjust__ (Prop p USES_REGS)
#endif #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 *PredEntryAdjust__ (PredEntry * CACHE_TYPE);
inline EXTERN PredEntry * inline EXTERN PredEntry *