fix max modules limitation

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1865 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2007-04-10 22:13:21 +00:00
parent c78a210afc
commit 67738fbbd1
14 changed files with 226 additions and 140 deletions

View File

@@ -621,12 +621,15 @@ InitReverseLookupOpcode(void)
op_numbers i;
/* 2 K should be OK */
int hash_size_mask = OP_HASH_SIZE-1;
UInt sz = OP_HASH_SIZE*sizeof(struct opcode_tab_entry);
if (OP_RTABLE == NULL)
OP_RTABLE = (opentry *)Yap_AllocCodeSpace(OP_HASH_SIZE*sizeof(struct opcode_tab_entry));
if (OP_RTABLE == NULL) {
Yap_Error(INTERNAL_ERROR, TermNil,
"Couldn't obtain space for the reverse translation opcode table");
while (OP_RTABLE == NULL) {
if ((OP_RTABLE = (opentry *)Yap_AllocCodeSpace(sz)) == NULL) {
if (!Yap_growheap(FALSE, sz, NULL)) {
Yap_Error(INTERNAL_ERROR, TermNil,
"Couldn't obtain space for the reverse translation opcode table");
}
}
}
opeptr = OP_RTABLE;
/* clear up table */