absmi.c: no need to reload CACHED_A1() during expand, and doing so will

destroy S and break RISC
alloc.c: guarantee alignment by 8 for SPARC32
iopreds.c: get rid of unnecessary decl\


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@938 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2003-11-28 01:26:53 +00:00
parent 01703de3a0
commit 2867b43f06
4 changed files with 15 additions and 6 deletions

View File

@ -6389,12 +6389,11 @@ Yap_absmi(int inp)
if (ASP > (CELL *) B) {
ASP = (CELL *) B;
}
saveregs();
saveregs();
pt0 = Yap_ExpandIndex(pe);
/* restart index */
setregs();
PREG = pt0;
CACHED_A1() = ARG1;
PREG = pt0;
JMPNext();
}
ENDBOp();

View File

@ -12,7 +12,7 @@
* Last rev: *
* mods: *
* comments: allocating space *
* version:$Id: alloc.c,v 1.41 2003-11-12 12:33:30 vsc Exp $ *
* version:$Id: alloc.c,v 1.42 2003-11-28 01:26:53 vsc Exp $ *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
@ -255,6 +255,14 @@ AllocHeap(unsigned int size)
#endif
if (size < (sizeof(YAP_SEG_SIZE)+sizeof(BlockHeader))/sizeof(CELL))
size = (sizeof(YAP_SEG_SIZE)+sizeof(BlockHeader))/sizeof(CELL);
#if SIZEOF_INT_P==4
/*
guarantee that the space seen by the user is always aligned at multiples
of a double word. This improves alignment, and guarantees correctness
for machines which require aligned 64 bits, such as SPARCs.
*/
if ((size & 1) == 0) size++;
#endif
LOCK(FreeBlocksLock);
if ((b = GetBlock(size))) {
if (b->b_size >= size + 6 + 1) {
@ -1048,6 +1056,7 @@ InitHeap(void *heap_addr)
HeapMax = HeapUsed = HeapTop-Yap_HeapBase;
/* notice that this forces odd addresses */
*((YAP_SEG_SIZE *) HeapTop) = InUseFlag;
HeapTop = HeapTop + sizeof(YAP_SEG_SIZE);
*((YAP_SEG_SIZE *) HeapTop) = InUseFlag;

View File

@ -132,7 +132,6 @@ STATIC_PROTO (Int p_current_input, (void));
STATIC_PROTO (Int p_current_output, (void));
STATIC_PROTO (Int p_write, (void));
STATIC_PROTO (Int p_write2, (void));
STATIC_PROTO (Int p_inform_of_clause, (void));
STATIC_PROTO (Int p_set_read_error_handler, (void));
STATIC_PROTO (Int p_get_read_error_handler, (void));
STATIC_PROTO (Int p_read, (void));

View File

@ -229,7 +229,6 @@ typedef struct pred_entry {
Int IndxId; /* Index for a certain key */
struct mfile *file_srcs; /* for multifile predicates */
} src;
struct pred_entry *NextPredOfModule; /* next pred for same module */
#if defined(YAPOR) || defined(THREADS)
rwlock_t PRWLock; /* a simple lock to protect this entry */
#endif
@ -237,7 +236,10 @@ typedef struct pred_entry {
tab_ent_ptr TableOfPred;
#endif /* TABLING */
SMALLUNSGN ModuleOfPred; /* module for this definition */
/* This must be at an odd number of cells, otherwise it
will not be aligned on RISC machines */
profile_data StatisticsForPred; /* enable profiling for predicate */
struct pred_entry *NextPredOfModule; /* next pred for same module */
} PredEntry;
#define PEProp ((PropFlags)(0x0000))