allow strong generic buffers in stack.

This commit is contained in:
Vitor Santos Costa
2011-07-21 02:24:21 -07:00
parent 2c8e6cf2d1
commit 7a33b8ebbf
4 changed files with 47 additions and 5 deletions

View File

@@ -59,6 +59,28 @@ Yap_MkBigIntTerm(MP_INT *big)
return AbsAppl(ret);
}
Term
Yap_AllocDynamicData(size_t bytes)
{
CACHE_REGS
Int nlimbs;
MP_INT *dst = (MP_INT *)(H+2);
CELL *ret = H;
nlimbs = ALIGN_YAPTYPE(bytes,CELL)/CellSize;
if (nlimbs > (ASP-ret)-1024) {
return TermNil;
}
H[0] = (CELL)FunctorBigInt;
H[1] = EXTERNAL_BLOB;
dst->_mp_size = 0;
dst->_mp_alloc = nlimbs;
H = (CELL *)(dst+1)+nlimbs;
H[0] = EndSpecials;
H++;
return AbsAppl(ret);
}
MP_INT *
Yap_BigIntOfTerm(Term t)
{