memory_xsb.h File Reference


Data Structures

struct  stack_info

Defines

#define top_of_heap   (hreg - 1)
#define top_of_localstk
#define top_of_trail   ((trreg > trfreg) ? trreg : trfreg)
#define top_of_cpstack   ((breg < bfreg) ? breg : bfreg)
#define top_of_complstk   openreg
#define IsInHeap(Ptr)
#define IsInEnv(Ptr)
#define IsInTrail(Ptr)
#define IsInCPS(Ptr)
#define COMPLSTACKBOTTOM   ((CPtr) complstack.high)
#define OVERFLOW_MARGIN   (8192 * ZOOM_FACTOR)
#define resize_stack(stack_size, min_exp)
#define ATOM_SPACE   0
#define STRING_SPACE   1
#define ASSERT_SPACE   2
#define COMPILED_SPACE   3
#define FOR_CODE_SPACE   4
#define TABLE_SPACE   5
#define FINDALL_SPACE   6
#define PROFILE_SPACE   7
#define MT_PRIVATE_SPACE   8
#define BUFF_SPACE   9
#define GC_SPACE   10
#define HASH_SPACE   11
#define INTERPROLOG_SPACE   12
#define THREAD_SPACE   13
#define READ_CAN_SPACE   14
#define LEAK_SPACE   15
#define SPECIAL_SPACE   16
#define OTHER_SPACE   17
#define NUM_CATS_SPACE   18
#define local_global_exception   "! Local/Global Stack Overflow Exception\n"
#define complstack_exception   "! Completion Stack Overflow Exception\n"
#define trail_cp_exception   "! Trail/CP Stack Overflow Exception\n"
#define check_tcpstack_overflow
#define check_glstack_overflow(arity, PCREG, EXTRA)
#define check_completion_stack_overflow

Typedefs

typedef stack_info System_Stack

Functions

void * mem_alloc (unsigned long, int)
void * mem_alloc_nocheck (unsigned long, int)
void * mem_calloc (unsigned long, unsigned long, int)
void * mem_realloc (void *, unsigned long, unsigned long, int)
void * mem_realloc_nocheck (void *, unsigned long, unsigned long, int)
void mem_dealloc (void *, unsigned long, int)
void tcpstack_realloc (long)
void complstack_realloc (long)
void handle_tcpstack_overflow (void)

Variables

System_Stack pdl
System_Stack glstack
System_Stack tcpstack
System_Stack complstack
long pspacesize [NUM_CATS_SPACE]
byteinst_begin_gl
Cell answer_return_inst
Cell check_complete_inst
Cell hash_handle_inst
Cell resume_compl_suspension_inst
Cell fail_inst
Cell dynfail_inst
Cell halt_inst
Cell proceed_inst
Cell resume_compl_suspension_inst2
Cell reset_inst
Cell trie_fail_unlock_inst

Define Documentation

#define ASSERT_SPACE   2
 

#define ATOM_SPACE   0
 

#define BUFF_SPACE   9
 

#define check_completion_stack_overflow
 

Value:

#define check_glstack_overflow arity,
PCREG,
EXTRA   ) 
 

Value:

if ((pb)top_of_localstk < (pb)top_of_heap + OVERFLOW_MARGIN + EXTRA) {     \
     if ((pb)top_of_localstk < (pb)top_of_heap) {                             \
       xsb_basic_abort("\nFatal ERROR:  -- "                                  \
                                 "Local Stack clobbered Heap --\n");          \
     }                                                                        \
     else {                                                                   \
       if ((pflags[STACK_REALLOC] == FALSE) ||                                \
           (glstack_ensure_space(CTXTc EXTRA,arity) != 0)) {                          \
         xsb_basic_abort(local_global_exception);                             \
       }                                                                      \
     }                                                                        \
   }

#define check_tcpstack_overflow
 

Value:

{                                       \
                                                                        \
   CPtr cps_top = top_of_cpstack;                                       \
                                                                        \
   if ((pb)cps_top < (pb)top_of_trail + OVERFLOW_MARGIN) {              \
     if ((pb)cps_top < (pb)top_of_trail) {                              \
       xsb_basic_abort("\nFatal ERROR:  -- Trail "                      \
                                  "clobbered Choice Point Stack --\n"); \
     }                                                                  \
     else {                                                             \
       if (pflags[STACK_REALLOC])                                       \
         tcpstack_realloc(CTXTc resize_stack(tcpstack.size,0));         \
       else {                                                           \
         xsb_basic_abort(trail_cp_exception);                           \
       }                                                                \
     }                                                                  \
   }                                                                    \
 }

#define COMPILED_SPACE   3
 

#define complstack_exception   "! Completion Stack Overflow Exception\n"
 

#define COMPLSTACKBOTTOM   ((CPtr) complstack.high)
 

#define FINDALL_SPACE   6
 

#define FOR_CODE_SPACE   4
 

#define GC_SPACE   10
 

#define HASH_SPACE   11
 

#define INTERPROLOG_SPACE   12
 

#define IsInCPS Ptr   ) 
 

Value:

( ( (CPtr)(Ptr) < (CPtr)cpstack.high ) &&       \
                          ( (CPtr)(Ptr) >= top_of_cpstack) )

#define IsInEnv Ptr   ) 
 

Value:

( ( (CPtr)(Ptr) < (CPtr)glstack.high ) &&       \
                          ( (CPtr)(Ptr) >= top_of_localstk) )

#define IsInHeap Ptr   ) 
 

Value:

( ( (CPtr)(Ptr) <= top_of_heap ) &&     \
                          ( (CPtr)(Ptr) >= (CPtr)glstack.low ) )

#define IsInTrail Ptr   ) 
 

Value:

( ( (CPtr)(Ptr) <= (CPtr)top_of_trail ) &&      \
                          ( (CPtr)(Ptr) >= (CPtr)cpstack.low ) )

#define LEAK_SPACE   15
 

#define local_global_exception   "! Local/Global Stack Overflow Exception\n"
 

#define MT_PRIVATE_SPACE   8
 

#define NUM_CATS_SPACE   18
 

#define OTHER_SPACE   17
 

#define OVERFLOW_MARGIN   (8192 * ZOOM_FACTOR)
 

#define PROFILE_SPACE   7
 

#define READ_CAN_SPACE   14
 

#define resize_stack stack_size,
min_exp   ) 
 

Value:

/*"stack_size" is in K-byte blocks*/\
   (((unsigned long)stack_size) < (min_exp)/K ? (stack_size) + (min_exp)/K : 2 * (stack_size))

#define SPECIAL_SPACE   16
 

#define STRING_SPACE   1
 

#define TABLE_SPACE   5
 

#define THREAD_SPACE   13
 

#define top_of_complstk   openreg
 

#define top_of_cpstack   ((breg < bfreg) ? breg : bfreg)
 

#define top_of_heap   (hreg - 1)
 

#define top_of_localstk
 

Value:

( ((efreg < ebreg) && (efreg < ereg)) \
                           ? efreg  \
                           : ( (ereg < ebreg) \
                               ? ereg - *(cpreg - 2*sizeof(Cell)+3) + 1 \
                               : ebreg ) )

#define top_of_trail   ((trreg > trfreg) ? trreg : trfreg)
 

#define trail_cp_exception   "! Trail/CP Stack Overflow Exception\n"
 


Typedef Documentation

typedef struct stack_info System_Stack
 


Function Documentation

void complstack_realloc long   ) 
 

void handle_tcpstack_overflow void   ) 
 

void* mem_alloc unsigned  long,
int 
 

void* mem_alloc_nocheck unsigned  long,
int 
 

void* mem_calloc unsigned  long,
unsigned  long,
int 
 

void mem_dealloc void *  ,
unsigned  long,
int 
 

void* mem_realloc void *  ,
unsigned  long,
unsigned  long,
int 
 

void* mem_realloc_nocheck void *  ,
unsigned  long,
unsigned  long,
int 
 

void tcpstack_realloc long   ) 
 


Variable Documentation

Cell answer_return_inst
 

Cell check_complete_inst
 

System_Stack complstack
 

Cell dynfail_inst
 

Cell fail_inst
 

System_Stack glstack
 

Cell halt_inst
 

Cell hash_handle_inst
 

byte* inst_begin_gl
 

System_Stack pdl
 

Cell proceed_inst
 

long pspacesize[NUM_CATS_SPACE]
 

Cell reset_inst
 

Cell resume_compl_suspension_inst
 

Cell resume_compl_suspension_inst2
 

System_Stack tcpstack
 

Cell trie_fail_unlock_inst
 


Generated on Wed Jul 26 13:26:54 2006 for XSB by  doxygen 1.4.5