patches to remove ints and be able to allocate a lot of memory in 64 bit mode.
This commit is contained in:
parent
751426c610
commit
901161a413
24
C/alloc.c
24
C/alloc.c
@ -88,7 +88,7 @@ minfo(char mtype)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline char *
|
static inline char *
|
||||||
call_malloc(unsigned int size)
|
call_malloc(unsigned long int size)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out;
|
||||||
#if INSTRUMENT_MALLOC
|
#if INSTRUMENT_MALLOC
|
||||||
@ -104,7 +104,7 @@ call_malloc(unsigned int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Yap_AllocCodeSpace(unsigned int size)
|
Yap_AllocCodeSpace(unsigned long int size)
|
||||||
{
|
{
|
||||||
return call_malloc(size);
|
return call_malloc(size);
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ Yap_FreeCodeSpace(char *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Yap_AllocAtomSpace(unsigned int size)
|
Yap_AllocAtomSpace(unsigned long int size)
|
||||||
{
|
{
|
||||||
return call_malloc(size);
|
return call_malloc(size);
|
||||||
}
|
}
|
||||||
@ -353,8 +353,8 @@ Yap_givemallinfo(void)
|
|||||||
#if !USE_DL_MALLOC
|
#if !USE_DL_MALLOC
|
||||||
|
|
||||||
STATIC_PROTO(void FreeBlock, (BlockHeader *));
|
STATIC_PROTO(void FreeBlock, (BlockHeader *));
|
||||||
STATIC_PROTO(BlockHeader *GetBlock, (unsigned int));
|
STATIC_PROTO(BlockHeader *GetBlock, (unsigned long int));
|
||||||
STATIC_PROTO(char *AllocHeap, (unsigned int));
|
STATIC_PROTO(char *AllocHeap, (unsigned long int));
|
||||||
STATIC_PROTO(void RemoveFromFreeList, (BlockHeader *));
|
STATIC_PROTO(void RemoveFromFreeList, (BlockHeader *));
|
||||||
STATIC_PROTO(void AddToFreeList, (BlockHeader *));
|
STATIC_PROTO(void AddToFreeList, (BlockHeader *));
|
||||||
|
|
||||||
@ -480,7 +480,7 @@ FreeBlock(BlockHeader *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static BlockHeader *
|
static BlockHeader *
|
||||||
GetBlock(unsigned int n)
|
GetBlock(unsigned long int n)
|
||||||
{ /* get free block with size at least n */
|
{ /* get free block with size at least n */
|
||||||
register BlockHeader **p, *b, *r;
|
register BlockHeader **p, *b, *r;
|
||||||
|
|
||||||
@ -509,7 +509,7 @@ GetBlock(unsigned int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
AllocHeap(unsigned int size)
|
AllocHeap(unsigned long int size)
|
||||||
{
|
{
|
||||||
BlockHeader *b, *n;
|
BlockHeader *b, *n;
|
||||||
YAP_SEG_SIZE *sp;
|
YAP_SEG_SIZE *sp;
|
||||||
@ -609,7 +609,7 @@ FreeCodeSpace(char *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
AllocCodeSpace(unsigned int size)
|
AllocCodeSpace(unsigned long int size)
|
||||||
{
|
{
|
||||||
if (size < SmallSize + 2 * OpCodeSize + 3 * CellSize)
|
if (size < SmallSize + 2 * OpCodeSize + 3 * CellSize)
|
||||||
return (AllocHeap(SmallSize + 2 * OpCodeSize + 3 * CellSize));
|
return (AllocHeap(SmallSize + 2 * OpCodeSize + 3 * CellSize));
|
||||||
@ -634,7 +634,7 @@ Yap_FreeCodeSpace(char *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Yap_AllocAtomSpace(unsigned int size)
|
Yap_AllocAtomSpace(unsigned long int size)
|
||||||
{
|
{
|
||||||
char *out = AllocHeap(size);
|
char *out = AllocHeap(size);
|
||||||
#if DEBUG_ALLOC
|
#if DEBUG_ALLOC
|
||||||
@ -654,7 +654,7 @@ Yap_FreeAtomSpace(char *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
Yap_AllocCodeSpace(unsigned int size)
|
Yap_AllocCodeSpace(unsigned long int size)
|
||||||
{
|
{
|
||||||
char *out = AllocCodeSpace(size);
|
char *out = AllocCodeSpace(size);
|
||||||
#if DEBUG_ALLOC
|
#if DEBUG_ALLOC
|
||||||
@ -1361,9 +1361,9 @@ Yap_InitHeap(void *heap_addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Yap_InitMemory(int Trail, int Heap, int Stack)
|
Yap_InitMemory(UInt Trail, UInt Heap, UInt Stack)
|
||||||
{
|
{
|
||||||
Int pm, sa, ta;
|
UInt pm, sa, ta;
|
||||||
|
|
||||||
pm = (Trail + Heap + Stack); /* memory to be
|
pm = (Trail + Heap + Stack); /* memory to be
|
||||||
* requested */
|
* requested */
|
||||||
|
2
C/init.c
2
C/init.c
@ -1289,7 +1289,7 @@ InitVersion(void)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Yap_InitWorkspace(int Heap, int Stack, int Trail, int max_table_size,
|
Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt max_table_size,
|
||||||
int n_workers, int sch_loop, int delay_load)
|
int n_workers, int sch_loop, int delay_load)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -87,13 +87,13 @@ void STD_PROTO(Yap_init_agc, (void));
|
|||||||
|
|
||||||
/* alloc.c */
|
/* alloc.c */
|
||||||
void STD_PROTO(Yap_FreeCodeSpace,(char *));
|
void STD_PROTO(Yap_FreeCodeSpace,(char *));
|
||||||
char *STD_PROTO(Yap_AllocAtomSpace,(unsigned int));
|
char *STD_PROTO(Yap_AllocAtomSpace,(unsigned long int));
|
||||||
char *STD_PROTO(Yap_AllocCodeSpace,(unsigned int));
|
char *STD_PROTO(Yap_AllocCodeSpace,(unsigned long int));
|
||||||
ADDR STD_PROTO(Yap_AllocFromForeignArea,(Int));
|
ADDR STD_PROTO(Yap_AllocFromForeignArea,(Int));
|
||||||
int STD_PROTO(Yap_ExtendWorkSpace,(Int));
|
int STD_PROTO(Yap_ExtendWorkSpace,(Int));
|
||||||
void STD_PROTO(Yap_FreeAtomSpace,(char *));
|
void STD_PROTO(Yap_FreeAtomSpace,(char *));
|
||||||
int STD_PROTO(Yap_FreeWorkSpace, (void));
|
int STD_PROTO(Yap_FreeWorkSpace, (void));
|
||||||
void STD_PROTO(Yap_InitMemory,(int,int,int));
|
void STD_PROTO(Yap_InitMemory,(UInt,UInt,UInt));
|
||||||
void STD_PROTO(Yap_InitExStacks,(int,int));
|
void STD_PROTO(Yap_InitExStacks,(int,int));
|
||||||
|
|
||||||
/* amasm.c */
|
/* amasm.c */
|
||||||
@ -221,7 +221,7 @@ void STD_PROTO(Yap_InitCPredBack,(char *, unsigned long int, unsigned int, CPred
|
|||||||
void STD_PROTO(Yap_InitCPredBackCut,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,int));
|
void STD_PROTO(Yap_InitCPredBackCut,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,int));
|
||||||
void STD_PROTO(Yap_InitCPredBack_,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,int));
|
void STD_PROTO(Yap_InitCPredBack_,(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,int));
|
||||||
#endif
|
#endif
|
||||||
void STD_PROTO(Yap_InitWorkspace,(int,int,int,int,int,int,int));
|
void STD_PROTO(Yap_InitWorkspace,(UInt,UInt,UInt,UInt,int,int,int));
|
||||||
|
|
||||||
#if defined(YAPOR) || defined(THREADS)
|
#if defined(YAPOR) || defined(THREADS)
|
||||||
void STD_PROTO(Yap_KillStacks,(int));
|
void STD_PROTO(Yap_KillStacks,(int));
|
||||||
|
Reference in New Issue
Block a user