mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 04:30:19 +02:00
Small fixes. Gets to the REPL and `abort ()'s soon after.
* libguile/inline.h (scm_cell): Re-added comment about the assignment order of CAR/CDR. * libguile/srcprop.c (scm_make_srcprops): Use `scm_gc_malloc ()' instead of `malloc' + `scm_gc_register_collectable_memory ()'. * libguile/threads.c (guilify_self_1): Likewise. (guilify_self_2): Likewise. * libguile/strings.c (make_stringbuf): Use `GC_MALLOC_ATOMIC ()' instead of `scm_gc_malloc ()'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-2
This commit is contained in:
parent
26224b3f5d
commit
c812243ba1
4 changed files with 11 additions and 7 deletions
|
@ -73,8 +73,12 @@ scm_cell (scm_t_bits car, scm_t_bits cdr)
|
||||||
{
|
{
|
||||||
SCM cell = SCM_PACK ((scm_t_bits) (GC_malloc (sizeof (scm_t_cell))));
|
SCM cell = SCM_PACK ((scm_t_bits) (GC_malloc (sizeof (scm_t_cell))));
|
||||||
|
|
||||||
SCM_GC_SET_CELL_WORD (cell, 0, car);
|
/* Initialize the type slot last so that the cell is ignored by the GC
|
||||||
|
until it is completely initialized. This is only relevant when the GC
|
||||||
|
can actually run during this code, which it can't since the GC only runs
|
||||||
|
when all other threads are stopped. */
|
||||||
SCM_GC_SET_CELL_WORD (cell, 1, cdr);
|
SCM_GC_SET_CELL_WORD (cell, 1, cdr);
|
||||||
|
SCM_GC_SET_CELL_WORD (cell, 0, car);
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,10 +112,9 @@ scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM plist)
|
||||||
scm_t_srcprops_chunk *mem;
|
scm_t_srcprops_chunk *mem;
|
||||||
size_t n = sizeof (scm_t_srcprops_chunk)
|
size_t n = sizeof (scm_t_srcprops_chunk)
|
||||||
+ sizeof (scm_t_srcprops) * (SRCPROPS_CHUNKSIZE - 1);
|
+ sizeof (scm_t_srcprops) * (SRCPROPS_CHUNKSIZE - 1);
|
||||||
SCM_SYSCALL (mem = (scm_t_srcprops_chunk *) scm_malloc (n));
|
mem = scm_gc_malloc (n, "srcprops");
|
||||||
if (mem == NULL)
|
if (mem == NULL)
|
||||||
scm_memory_error ("srcprops");
|
scm_memory_error ("srcprops");
|
||||||
scm_gc_register_collectable_memory (mem, n, "srcprops");
|
|
||||||
|
|
||||||
mem->next = srcprops_chunklist;
|
mem->next = srcprops_chunklist;
|
||||||
srcprops_chunklist = mem;
|
srcprops_chunklist = mem;
|
||||||
|
|
|
@ -115,7 +115,8 @@ make_stringbuf (size_t len)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *mem = scm_gc_malloc (len+1, "string");
|
/* FIXME: Create an `scm_gc' equivalent to `GC_MALLOC_ATOMIC ()'. */
|
||||||
|
char *mem = GC_MALLOC_ATOMIC (len + 1);/* scm_gc_malloc (len+1, "string"); */
|
||||||
mem[len] = '\0';
|
mem[len] = '\0';
|
||||||
return scm_double_cell (STRINGBUF_TAG, (scm_t_bits) mem,
|
return scm_double_cell (STRINGBUF_TAG, (scm_t_bits) mem,
|
||||||
(scm_t_bits) len, (scm_t_bits) 0);
|
(scm_t_bits) len, (scm_t_bits) 0);
|
||||||
|
|
|
@ -382,7 +382,7 @@ static SCM scm_i_default_dynamic_state;
|
||||||
static void
|
static void
|
||||||
guilify_self_1 (SCM_STACKITEM *base)
|
guilify_self_1 (SCM_STACKITEM *base)
|
||||||
{
|
{
|
||||||
scm_i_thread *t = malloc (sizeof (scm_i_thread));
|
scm_i_thread *t = scm_gc_malloc (sizeof (scm_i_thread), "thread");
|
||||||
|
|
||||||
t->pthread = scm_i_pthread_self ();
|
t->pthread = scm_i_pthread_self ();
|
||||||
t->handle = SCM_BOOL_F;
|
t->handle = SCM_BOOL_F;
|
||||||
|
@ -432,7 +432,7 @@ guilify_self_2 (SCM parent)
|
||||||
scm_i_thread *t = SCM_I_CURRENT_THREAD;
|
scm_i_thread *t = SCM_I_CURRENT_THREAD;
|
||||||
|
|
||||||
SCM_NEWSMOB (t->handle, scm_tc16_thread, t);
|
SCM_NEWSMOB (t->handle, scm_tc16_thread, t);
|
||||||
scm_gc_register_collectable_memory (t, sizeof (scm_i_thread), "thread");
|
|
||||||
t->continuation_root = scm_cons (t->handle, SCM_EOL);
|
t->continuation_root = scm_cons (t->handle, SCM_EOL);
|
||||||
t->continuation_base = t->base;
|
t->continuation_base = t->base;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue