LoadRF::LoadRF(EPRecord *_load, ConstGen *cg) : load(_load) {
RecordSet *mrfSet=cg->getMayReadFromSet(load);
uint numstores=mrfSet->getSize();
- numvars=NUMBITS(numstores-1);
+ numvars=NUMBITS(numstores);
vars=(Constraint **)model_malloc(numvars*sizeof(Constraint *));
cg->getArrayNewVars(numvars, vars);
}
/** Allocate a stack for a new thread. */
static void * stack_allocate(size_t size)
{
+ // TODO: This could be a bug if we have programs that start threads
+ // in different orders. The solution is to use the same strategy
+ // the ALLOC action uses.
+
return snapshot_malloc(size);
}