pointer cells/planeet fixups
This commit is contained in:
parent
b306080171
commit
f7d33a5931
12
src/gc.c
12
src/gc.c
|
@ -36,8 +36,13 @@
|
||||||
|
|
||||||
void init_symbols_ ();
|
void init_symbols_ ();
|
||||||
|
|
||||||
|
#if __M2_PLANET__
|
||||||
|
#define M2_CELL_SIZE 12
|
||||||
// CONSTANT M2_CELL_SIZE 12
|
// CONSTANT M2_CELL_SIZE 12
|
||||||
|
#else
|
||||||
#define M2_CELL_SIZE 1
|
#define M2_CELL_SIZE 1
|
||||||
|
// CONSTANT M2_CELL_SIZE 12
|
||||||
|
#endif
|
||||||
|
|
||||||
#if POINTER_CELLS
|
#if POINTER_CELLS
|
||||||
long g_stack;
|
long g_stack;
|
||||||
|
@ -59,7 +64,12 @@ struct scm *g_news;
|
||||||
char *
|
char *
|
||||||
cell_bytes (SCM x)
|
cell_bytes (SCM x)
|
||||||
{
|
{
|
||||||
|
#if POINTER_CELLS
|
||||||
|
char *p = x;
|
||||||
|
return p + (2 * sizeof (long));
|
||||||
|
#else
|
||||||
return &CDR (x);
|
return &CDR (x);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@ -236,7 +246,7 @@ make_bytes (char const *s, size_t length)
|
||||||
SCM x = alloc (size);
|
SCM x = alloc (size);
|
||||||
TYPE (x) = TBYTES;
|
TYPE (x) = TBYTES;
|
||||||
LENGTH (x) = length;
|
LENGTH (x) = length;
|
||||||
char *p = &CDR (x);
|
char *p = cell_bytes (x);
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
p[0] = 0;
|
p[0] = 0;
|
||||||
else
|
else
|
||||||
|
|
|
@ -23,6 +23,14 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#if __M2_PLANET__
|
||||||
|
#define M2_CELL_SIZE 12
|
||||||
|
// CONSTANT M2_CELL_SIZE 12
|
||||||
|
#else
|
||||||
|
#define M2_CELL_SIZE 1
|
||||||
|
// CONSTANT M2_CELL_SIZE 12
|
||||||
|
#endif
|
||||||
|
|
||||||
#if POINTER_CELLS
|
#if POINTER_CELLS
|
||||||
SCM g_symbol;
|
SCM g_symbol;
|
||||||
#else
|
#else
|
||||||
|
@ -34,7 +42,7 @@ init_symbol (SCM x, long type, char const *name)
|
||||||
{
|
{
|
||||||
TYPE (x) = type;
|
TYPE (x) = type;
|
||||||
if (!g_symbols)
|
if (!g_symbols)
|
||||||
g_free = g_free + 1;
|
g_free = g_free + M2_CELL_SIZE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int length = strlen (name);
|
int length = strlen (name);
|
||||||
|
@ -43,7 +51,7 @@ init_symbol (SCM x, long type, char const *name)
|
||||||
CDR (x) = STRING (string);
|
CDR (x) = STRING (string);
|
||||||
hash_set_x (g_symbols, string, x);
|
hash_set_x (g_symbols, string, x);
|
||||||
}
|
}
|
||||||
g_symbol = g_symbol + 1;
|
g_symbol = g_symbol + M2_CELL_SIZE;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +183,7 @@ SCM
|
||||||
init_symbols () /*:((internal)) */
|
init_symbols () /*:((internal)) */
|
||||||
{
|
{
|
||||||
#if POINTER_CELLS
|
#if POINTER_CELLS
|
||||||
g_free = g_cells + 1;
|
g_free = g_cells + M2_CELL_SIZE;
|
||||||
#else
|
#else
|
||||||
g_free = 1;
|
g_free = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue