* Renamed ALIGN into ELK_ALIGN because OS X's <ppc/param.h> defines it.
git-svn-id: svn://svn.zoy.org/elk/trunk@197 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
parent
5b1cb65202
commit
c72bef9733
|
@ -46,9 +46,9 @@ extern_c Object elk_import False2;
|
||||||
|
|
||||||
/* Align heap addresses */
|
/* Align heap addresses */
|
||||||
#ifdef ALIGN_8BYTE
|
#ifdef ALIGN_8BYTE
|
||||||
# define ALIGN(ptr) ((ptr) = (void *)(((intptr_t)(ptr) + 7) & ~7))
|
# define ELK_ALIGN(ptr) ((ptr) = (void *)(((intptr_t)(ptr) + 7) & ~7))
|
||||||
#else
|
#else
|
||||||
# define ALIGN(ptr) ((ptr) = (void *)(((intptr_t)(ptr) + 3) & ~3))
|
# define ELK_ALIGN(ptr) ((ptr) = (void *)(((intptr_t)(ptr) + 3) & ~3))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Normalize stack addresses */
|
/* Normalize stack addresses */
|
||||||
|
|
|
@ -72,11 +72,11 @@ Object Alloc_Object (int size, int type, int konst) {
|
||||||
(void)P_Collect ();
|
(void)P_Collect ();
|
||||||
p = Hp;
|
p = Hp;
|
||||||
}
|
}
|
||||||
ALIGN(p);
|
ELK_ALIGN(p);
|
||||||
if (p + size > Heap_End) {
|
if (p + size > Heap_End) {
|
||||||
(void)P_Collect ();
|
(void)P_Collect ();
|
||||||
p = Hp;
|
p = Hp;
|
||||||
ALIGN(p);
|
ELK_ALIGN(p);
|
||||||
if (p + size > Heap_End - HEAP_MARGIN)
|
if (p + size > Heap_End - HEAP_MARGIN)
|
||||||
Uncatchable_Error ("Out of heap space");
|
Uncatchable_Error ("Out of heap space");
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ again:
|
||||||
SETPOINTER(*p, POINTER(*tag));
|
SETPOINTER(*p, POINTER(*tag));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ALIGN(To);
|
ELK_ALIGN(To);
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case T_Bignum:
|
case T_Bignum:
|
||||||
size = sizeof (struct S_Bignum) - sizeof (gran_t)
|
size = sizeof (struct S_Bignum) - sizeof (gran_t)
|
||||||
|
|
|
@ -285,7 +285,7 @@ void Elk_Init (int ac, char **av, int init_objects, char *toplevel) {
|
||||||
|
|
||||||
stkbase = &foo;
|
stkbase = &foo;
|
||||||
Stack_Grows_Down = Check_Stack_Grows_Down ();
|
Stack_Grows_Down = Check_Stack_Grows_Down ();
|
||||||
ALIGN(stkbase);
|
ELK_ALIGN(stkbase);
|
||||||
Make_Heap (heap);
|
Make_Heap (heap);
|
||||||
Init_Everything ();
|
Init_Everything ();
|
||||||
#ifdef HAVE_ATEXIT
|
#ifdef HAVE_ATEXIT
|
||||||
|
|
|
@ -58,7 +58,7 @@ Object P_Cons (Object car, Object cdr) {
|
||||||
register char *p;
|
register char *p;
|
||||||
|
|
||||||
p = Hp;
|
p = Hp;
|
||||||
ALIGN(p);
|
ELK_ALIGN(p);
|
||||||
if (p + sizeof (struct S_Pair) <= Heap_End && !GC_Debug) {
|
if (p + sizeof (struct S_Pair) <= Heap_End && !GC_Debug) {
|
||||||
Hp = p + sizeof (struct S_Pair);
|
Hp = p + sizeof (struct S_Pair);
|
||||||
SET(cell, T_Pair, (struct S_Pair *)p);
|
SET(cell, T_Pair, (struct S_Pair *)p);
|
||||||
|
|
Loading…
Reference in New Issue