mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
PTR2SCM and SCM2PTR in inline.h
* libguile/inline.h (scm_cell, scm_immutable_cell): (scm_double_cell, scm_immutable_double_cell): (scm_words): Be more consistent in use of PTR2SCM and SCM2PTR.
This commit is contained in:
parent
6ef437665c
commit
a3069bace8
1 changed files with 7 additions and 7 deletions
|
@ -123,7 +123,7 @@ SCM_C_EXTERN_INLINE
|
||||||
SCM
|
SCM
|
||||||
scm_cell (scm_t_bits car, scm_t_bits cdr)
|
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 = PTR2SCM (GC_MALLOC (sizeof (scm_t_cell)));
|
||||||
|
|
||||||
/* Initialize the type slot last so that the cell is ignored by the GC
|
/* 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
|
until it is completely initialized. This is only relevant when the GC
|
||||||
|
@ -141,7 +141,7 @@ SCM_C_EXTERN_INLINE
|
||||||
SCM
|
SCM
|
||||||
scm_immutable_cell (scm_t_bits car, scm_t_bits cdr)
|
scm_immutable_cell (scm_t_bits car, scm_t_bits cdr)
|
||||||
{
|
{
|
||||||
SCM cell = SCM_PACK ((scm_t_bits) (GC_MALLOC_STUBBORN (sizeof (scm_t_cell))));
|
SCM cell = PTR2SCM (GC_MALLOC_STUBBORN (sizeof (scm_t_cell)));
|
||||||
|
|
||||||
/* Initialize the type slot last so that the cell is ignored by the GC
|
/* 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
|
until it is completely initialized. This is only relevant when the GC
|
||||||
|
@ -150,7 +150,7 @@ scm_immutable_cell (scm_t_bits car, scm_t_bits cdr)
|
||||||
SCM_GC_SET_CELL_WORD (cell, 1, cdr);
|
SCM_GC_SET_CELL_WORD (cell, 1, cdr);
|
||||||
SCM_GC_SET_CELL_WORD (cell, 0, car);
|
SCM_GC_SET_CELL_WORD (cell, 0, car);
|
||||||
|
|
||||||
GC_END_STUBBORN_CHANGE ((void *) cell);
|
GC_END_STUBBORN_CHANGE (SCM2PTR (cell));
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ scm_double_cell (scm_t_bits car, scm_t_bits cbr,
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
|
|
||||||
z = SCM_PACK ((scm_t_bits) (GC_MALLOC (2 * sizeof (scm_t_cell))));
|
z = PTR2SCM (GC_MALLOC (2 * sizeof (scm_t_cell)));
|
||||||
/* Initialize the type slot last so that the cell is ignored by the
|
/* Initialize the type slot last so that the cell is ignored by the
|
||||||
GC until it is completely initialized. This is only relevant
|
GC until it is completely initialized. This is only relevant
|
||||||
when the GC can actually run during this code, which it can't
|
when the GC can actually run during this code, which it can't
|
||||||
|
@ -207,7 +207,7 @@ scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
|
|
||||||
z = SCM_PACK ((scm_t_bits) (GC_MALLOC_STUBBORN (2 * sizeof (scm_t_cell))));
|
z = PTR2SCM (GC_MALLOC_STUBBORN (2 * sizeof (scm_t_cell)));
|
||||||
/* Initialize the type slot last so that the cell is ignored by the
|
/* Initialize the type slot last so that the cell is ignored by the
|
||||||
GC until it is completely initialized. This is only relevant
|
GC until it is completely initialized. This is only relevant
|
||||||
when the GC can actually run during this code, which it can't
|
when the GC can actually run during this code, which it can't
|
||||||
|
@ -218,7 +218,7 @@ scm_immutable_double_cell (scm_t_bits car, scm_t_bits cbr,
|
||||||
SCM_GC_SET_CELL_WORD (z, 3, cdr);
|
SCM_GC_SET_CELL_WORD (z, 3, cdr);
|
||||||
SCM_GC_SET_CELL_WORD (z, 0, car);
|
SCM_GC_SET_CELL_WORD (z, 0, car);
|
||||||
|
|
||||||
GC_END_STUBBORN_CHANGE ((void *) z);
|
GC_END_STUBBORN_CHANGE (SCM2PTR (z));
|
||||||
|
|
||||||
/* When this function is inlined, it's possible that the last
|
/* When this function is inlined, it's possible that the last
|
||||||
SCM_GC_SET_CELL_WORD above will be adjacent to a following
|
SCM_GC_SET_CELL_WORD above will be adjacent to a following
|
||||||
|
@ -251,7 +251,7 @@ scm_words (scm_t_bits car, scm_t_uint16 n_words)
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
|
|
||||||
z = SCM_PACK ((scm_t_bits) (GC_MALLOC (sizeof (scm_t_bits) * n_words)));
|
z = PTR2SCM (GC_MALLOC (sizeof (scm_t_bits) * n_words));
|
||||||
SCM_GC_SET_CELL_WORD (z, 0, car);
|
SCM_GC_SET_CELL_WORD (z, 0, car);
|
||||||
|
|
||||||
/* FIXME: is the following concern even relevant with BDW-GC? */
|
/* FIXME: is the following concern even relevant with BDW-GC? */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue