should have been easy.

This commit is contained in:
Vítor Santos Costa 2011-12-13 12:16:42 +00:00
parent 707a3b9925
commit 98c849c087
2 changed files with 10 additions and 8 deletions

View File

@ -331,10 +331,11 @@ mark_global_cell(CELL *pt)
(((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/sizeof(CELL); (((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/sizeof(CELL);
Opaque_CallOnGCMark f; Opaque_CallOnGCMark f;
Opaque_CallOnGCRellocate f2; Opaque_CallOnGCRellocate f2;
Term t = AbsAppl(pt);
if ( (f = Yap_blob_gc_mark_handler(reg)) ) { if ( (f = Yap_blob_gc_mark_handler(t)) ) {
CELL ar[256]; CELL ar[256];
Int i,n = (f)(Yap_BlobTag(reg), Yap_BlobInfo(reg), ar, 256); Int i,n = (f)(Yap_BlobTag(t), Yap_BlobInfo(t), ar, 256);
if (n < 0) { if (n < 0) {
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"not enough space for slot internal variables in agc"); Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"not enough space for slot internal variables in agc");
} }
@ -345,8 +346,8 @@ mark_global_cell(CELL *pt)
*pt = AtomTermAdjust(reg); *pt = AtomTermAdjust(reg);
} }
} }
if ( (f2 = Yap_blob_gc_rellocate_handler(reg)) < 0 ) { if ( (f2 = Yap_blob_gc_rellocate_handler(t)) < 0 ) {
int out = (f2)(Yap_BlobTag(reg), Yap_BlobInfo(reg), ar, n); int out = (f2)(Yap_BlobTag(t), Yap_BlobInfo(t), ar, n);
if (out < 0) if (out < 0)
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"bad restore of slot internal variables in agc"); Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"bad restore of slot internal variables in agc");
} }

View File

@ -579,10 +579,11 @@ AdjustGlobal(long sz, int thread_copying USES_REGS)
(((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/CellSize; (((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/CellSize;
Opaque_CallOnGCMark f; Opaque_CallOnGCMark f;
Opaque_CallOnGCRellocate f2; Opaque_CallOnGCRellocate f2;
Term t = AbsAppl(pt);
if ( (f = Yap_blob_gc_mark_handler(reg)) ) { if ( (f = Yap_blob_gc_mark_handler(t)) ) {
CELL ar[256]; CELL ar[256];
Int i,n = (f)(Yap_BlobTag(reg), Yap_BlobInfo(reg), ar, 256); Int i,n = (f)(Yap_BlobTag(t), Yap_BlobInfo(t), ar, 256);
if (n < 0) { if (n < 0) {
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"not enough space for slot internal variables"); Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"not enough space for slot internal variables");
} }
@ -605,8 +606,8 @@ AdjustGlobal(long sz, int thread_copying USES_REGS)
else if (IsAtomTerm(reg)) else if (IsAtomTerm(reg))
*pt = AtomTermAdjust(reg); *pt = AtomTermAdjust(reg);
} }
if ( (f2 = Yap_blob_gc_rellocate_handler(reg)) < 0 ) { if ( (f2 = Yap_blob_gc_rellocate_handler(t)) < 0 ) {
int out = (f2)(Yap_BlobTag(reg), Yap_BlobInfo(reg), ar, n); int out = (f2)(Yap_BlobTag(t), Yap_BlobInfo(t), ar, n);
if (out < 0) if (out < 0)
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"bad restore of slot internal variables"); Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"bad restore of slot internal variables");
} }