mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-09 23:40:29 +02:00
Changes in doc/ref:
* api.txt, data-rep.texi: Renamed the struct scm_cell to scm_t_cell. * data-rep.texi: Renamed scm_alloc_cell to scm_cell and scm_alloc_double_cell to scm_double_cell. Changes in libguile: * gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL, init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE, SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct scm_cell and all its uses to scm_t_cell in accordance to Guile's naming scheme for types. * alist.c (scm_acons), convert.i.c (CTYPES2UVECT, CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread, scm_spawn_thread), debug.c (scm_make_debugobj), environments.c (scm_make_environment), eval.c (scm_closure), fports.c (scm_fdes_to_port), gc.c (scm_deprecated_newcell, scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell), list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons), ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo), smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c (scm_take_str, scm_allocate_string), strports.c (scm_mkstrport), unif.c (scm_make_uve), variable.c (make_variable), vectors.c (scm_c_make_vector), vports.c (scm_make_soft_port): Renamed scm_alloc_cell to scm_cell. * environments.c (core_environments_observe), gc.c (scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object), inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c (FLOAT2NUM), numbers.c (scm_make_real), procs.c (scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2, SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable), symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c (allocate_weak_vector): Renamed scm_alloc_double_cell to scm_double_cell.
This commit is contained in:
parent
eee065c4fe
commit
228a24ef30
35 changed files with 166 additions and 129 deletions
15
NEWS
15
NEWS
|
@ -52,6 +52,12 @@ Use `substring-move!' instead.
|
||||||
|
|
||||||
* Changes to the C interface
|
* Changes to the C interface
|
||||||
|
|
||||||
|
** The struct scm_cell has been renamed to scm_t_cell
|
||||||
|
|
||||||
|
This is in accordance to Guile's naming scheme for types. Note that
|
||||||
|
the name scm_cell is now used for a function that allocates and
|
||||||
|
initializes a new cell (see below).
|
||||||
|
|
||||||
** New functions for memory management
|
** New functions for memory management
|
||||||
|
|
||||||
A new set of functions for memory management has been added since the
|
A new set of functions for memory management has been added since the
|
||||||
|
@ -94,11 +100,10 @@ SCM_SRFI4_IMPORT, for the corresponding libraries.
|
||||||
|
|
||||||
** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated.
|
** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated.
|
||||||
|
|
||||||
Use the new functions scm_alloc_cell and scm_alloc_double_cell
|
Use the new functions scm_cell and scm_double_cell instead. The old macros
|
||||||
instead. The old macros had problems because with them allocation and
|
had problems because with them allocation and initialization was separated and
|
||||||
initialization was separated and the GC could sometimes observe half
|
the GC could sometimes observe half initialized cells. Only careful coding by
|
||||||
initialized cells. Only careful coding by the user of SCM_NEWCELL and
|
the user of SCM_NEWCELL and SCM_NEWCELL2 could make this safe and efficient.
|
||||||
SCM_NEWCELL2 could make this safe and efficient.
|
|
||||||
|
|
||||||
Changes since Guile 1.4:
|
Changes since Guile 1.4:
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2002-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* api.txt, data-rep.texi: Renamed the struct scm_cell to
|
||||||
|
scm_t_cell.
|
||||||
|
|
||||||
|
* data-rep.texi: Renamed scm_alloc_cell to scm_cell and
|
||||||
|
scm_alloc_double_cell to scm_double_cell.
|
||||||
|
|
||||||
2002-03-01 Marius Vollmer <mvo@zagadka.ping.de>
|
2002-03-01 Marius Vollmer <mvo@zagadka.ping.de>
|
||||||
|
|
||||||
* scheme-memory.texi (Upgrading from scm_must_malloc et al): New
|
* scheme-memory.texi (Upgrading from scm_must_malloc et al): New
|
||||||
|
|
|
@ -66,8 +66,8 @@ determined from the scm_bits_t value that is delivered by SCM_UNPACK (x).
|
||||||
Non immediate objects
|
Non immediate objects
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
- (scm_cell *) SCM2PTR (SCM x) (FIXME:: this name should be changed)
|
- (scm_t_cell *) SCM2PTR (SCM x) (FIXME:: this name should be changed)
|
||||||
- SCM PTR2SCM (scm_cell * x) (FIXME:: this name should be changed)
|
- SCM PTR2SCM (scm_t_cell * x) (FIXME:: this name should be changed)
|
||||||
|
|
||||||
A scheme object of type SCM that does not fullfill the SCM_IMP predicate holds
|
A scheme object of type SCM that does not fullfill the SCM_IMP predicate holds
|
||||||
an encoded reference to a heap cell. This reference can be decoded to a C
|
an encoded reference to a heap cell. This reference can be decoded to a C
|
||||||
|
@ -76,14 +76,14 @@ a heap cell into a SCM value is done using the PTR2SCM macro.
|
||||||
|
|
||||||
Note that it is also possible to transform a non immediate SCM value by using
|
Note that it is also possible to transform a non immediate SCM value by using
|
||||||
SCM_UNPACK into a scm_bits_t variable. Hower, the result of SCM_UNPACK may
|
SCM_UNPACK into a scm_bits_t variable. Hower, the result of SCM_UNPACK may
|
||||||
not be used as a pointer to a scm_cell: Only SCM2PTR is guaranteed to
|
not be used as a pointer to a scm_t_cell: Only SCM2PTR is guaranteed to
|
||||||
transform a SCM object into a valid pointer to a heap cell. Also, it is not
|
transform a SCM object into a valid pointer to a heap cell. Also, it is not
|
||||||
allowed to apply PTR2SCM to anything that is not a valid pointer to a heap
|
allowed to apply PTR2SCM to anything that is not a valid pointer to a heap
|
||||||
cell.
|
cell.
|
||||||
|
|
||||||
Summary:
|
Summary:
|
||||||
* Only use SCM2PTR for SCM values for which SCM_IMP is false!
|
* Only use SCM2PTR for SCM values for which SCM_IMP is false!
|
||||||
* Don't use '(scm_cell*) SCM_UNPACK (x)'! Use 'SCM2PTR (x)' instead!
|
* Don't use '(scm_t_cell*) SCM_UNPACK (x)'! Use 'SCM2PTR (x)' instead!
|
||||||
* Don't use PTR2SCM for anything but a cell pointer!
|
* Don't use PTR2SCM for anything but a cell pointer!
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
@c essay @sp 10
|
@c essay @sp 10
|
||||||
@c essay @comment The title is printed in a large font.
|
@c essay @comment The title is printed in a large font.
|
||||||
@c essay @title Data Representation in Guile
|
@c essay @title Data Representation in Guile
|
||||||
@c essay @subtitle $Id: data-rep.texi,v 1.4 2002-02-28 20:58:50 mvo Exp $
|
@c essay @subtitle $Id: data-rep.texi,v 1.5 2002-03-01 00:19:20 dirk Exp $
|
||||||
@c essay @subtitle For use with Guile @value{VERSION}
|
@c essay @subtitle For use with Guile @value{VERSION}
|
||||||
@c essay @author Jim Blandy
|
@c essay @author Jim Blandy
|
||||||
@c essay @author Free Software Foundation
|
@c essay @author Free Software Foundation
|
||||||
|
@ -1150,13 +1150,13 @@ This reference can be decoded to a C pointer to a heap cell using the
|
||||||
@code{SCM} value is done using the @code{PTR2SCM} macro.
|
@code{SCM} value is done using the @code{PTR2SCM} macro.
|
||||||
|
|
||||||
@c (FIXME:: this name should be changed)
|
@c (FIXME:: this name should be changed)
|
||||||
@deftypefn Macro (scm_cell *) SCM2PTR (SCM @var{x})
|
@deftypefn Macro (scm_t_cell *) SCM2PTR (SCM @var{x})
|
||||||
Extract and return the heap cell pointer from a non-immediate @code{SCM}
|
Extract and return the heap cell pointer from a non-immediate @code{SCM}
|
||||||
object @var{x}.
|
object @var{x}.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
||||||
@c (FIXME:: this name should be changed)
|
@c (FIXME:: this name should be changed)
|
||||||
@deftypefn Macro SCM PTR2SCM (scm_cell * @var{x})
|
@deftypefn Macro SCM PTR2SCM (scm_t_cell * @var{x})
|
||||||
Return a @code{SCM} value that encodes a reference to the heap cell
|
Return a @code{SCM} value that encodes a reference to the heap cell
|
||||||
pointer @var{x}.
|
pointer @var{x}.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
@ -1164,7 +1164,7 @@ pointer @var{x}.
|
||||||
Note that it is also possible to transform a non-immediate @code{SCM}
|
Note that it is also possible to transform a non-immediate @code{SCM}
|
||||||
value by using @code{SCM_UNPACK} into a @code{scm_t_bits} variable.
|
value by using @code{SCM_UNPACK} into a @code{scm_t_bits} variable.
|
||||||
However, the result of @code{SCM_UNPACK} may not be used as a pointer to
|
However, the result of @code{SCM_UNPACK} may not be used as a pointer to
|
||||||
a @code{scm_cell}: only @code{SCM2PTR} is guaranteed to transform a
|
a @code{scm_t_cell}: only @code{SCM2PTR} is guaranteed to transform a
|
||||||
@code{SCM} object into a valid pointer to a heap cell. Also, it is not
|
@code{SCM} object into a valid pointer to a heap cell. Also, it is not
|
||||||
allowed to apply @code{PTR2SCM} to anything that is not a valid pointer
|
allowed to apply @code{PTR2SCM} to anything that is not a valid pointer
|
||||||
to a heap cell.
|
to a heap cell.
|
||||||
|
@ -1176,7 +1176,7 @@ Summary:
|
||||||
Only use @code{SCM2PTR} on @code{SCM} values for which @code{SCM_IMP} is
|
Only use @code{SCM2PTR} on @code{SCM} values for which @code{SCM_IMP} is
|
||||||
false!
|
false!
|
||||||
@item
|
@item
|
||||||
Don't use @code{(scm_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR
|
Don't use @code{(scm_t_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR
|
||||||
(@var{x})} instead!
|
(@var{x})} instead!
|
||||||
@item
|
@item
|
||||||
Don't use @code{PTR2SCM} for anything but a cell pointer!
|
Don't use @code{PTR2SCM} for anything but a cell pointer!
|
||||||
|
@ -1198,7 +1198,7 @@ the code in @code{<libguile/tags.h>}.
|
||||||
|
|
||||||
If you just want to allocate pairs, use @code{scm_cons}.
|
If you just want to allocate pairs, use @code{scm_cons}.
|
||||||
|
|
||||||
@deftypefn Function SCM scm_alloc_cell (scm_t_bits word_0, scm_t_bits word_1)
|
@deftypefn Function SCM scm_cell (scm_t_bits word_0, scm_t_bits word_1)
|
||||||
Allocate a new cell, initialize the two slots with @var{word_0} and
|
Allocate a new cell, initialize the two slots with @var{word_0} and
|
||||||
@var{word_1}, and return it.
|
@var{word_1}, and return it.
|
||||||
|
|
||||||
|
@ -1207,8 +1207,8 @@ If you want to pass a @code{SCM} object, you need to use
|
||||||
@code{SCM_UNPACK}.
|
@code{SCM_UNPACK}.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
||||||
@deftypefn Function SCM scm_alloc_double_cell (scm_t_bits word_0, scm_t_bits word_1, scm_t_bits word_2, scm_t_bits word_3)
|
@deftypefn Function SCM scm_double_cell (scm_t_bits word_0, scm_t_bits word_1, scm_t_bits word_2, scm_t_bits word_3)
|
||||||
Like @code{scm_alloc_cell}, but allocates a double cell with four
|
Like @code{scm_cell}, but allocates a double cell with four
|
||||||
slots.
|
slots.
|
||||||
@end deftypefn
|
@end deftypefn
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,36 @@
|
||||||
|
2002-03-01 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL,
|
||||||
|
init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct
|
||||||
|
scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE,
|
||||||
|
SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct
|
||||||
|
scm_cell and all its uses to scm_t_cell in accordance to Guile's
|
||||||
|
naming scheme for types.
|
||||||
|
|
||||||
|
* alist.c (scm_acons), convert.i.c (CTYPES2UVECT,
|
||||||
|
CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread,
|
||||||
|
scm_spawn_thread), debug.c (scm_make_debugobj), environments.c
|
||||||
|
(scm_make_environment), eval.c (scm_closure), fports.c
|
||||||
|
(scm_fdes_to_port), gc.c (scm_deprecated_newcell,
|
||||||
|
scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell),
|
||||||
|
list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons),
|
||||||
|
ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo),
|
||||||
|
smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c
|
||||||
|
(scm_take_str, scm_allocate_string), strports.c (scm_mkstrport),
|
||||||
|
unif.c (scm_make_uve), variable.c (make_variable), vectors.c
|
||||||
|
(scm_c_make_vector), vports.c (scm_make_soft_port): Renamed
|
||||||
|
scm_alloc_cell to scm_cell.
|
||||||
|
|
||||||
|
* environments.c (core_environments_observe), gc.c
|
||||||
|
(scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object),
|
||||||
|
inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c
|
||||||
|
(FLOAT2NUM), numbers.c (scm_make_real), procs.c
|
||||||
|
(scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2,
|
||||||
|
SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable),
|
||||||
|
symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c
|
||||||
|
(allocate_weak_vector): Renamed scm_alloc_double_cell to
|
||||||
|
scm_double_cell.
|
||||||
|
|
||||||
2002-02-27 Stefan Jahn <stefan@lkcc.org>
|
2002-02-27 Stefan Jahn <stefan@lkcc.org>
|
||||||
|
|
||||||
* convert.i.c, convert.c: Better range checking.
|
* convert.i.c, convert.c: Better range checking.
|
||||||
|
|
|
@ -59,7 +59,7 @@ SCM_DEFINE (scm_acons, "acons", 3, 0, 0,
|
||||||
"function is @emph{not} destructive; @var{alist} is not modified.")
|
"function is @emph{not} destructive; @var{alist} is not modified.")
|
||||||
#define FUNC_NAME s_scm_acons
|
#define FUNC_NAME s_scm_acons
|
||||||
{
|
{
|
||||||
return scm_alloc_cell (SCM_UNPACK (scm_alloc_cell (SCM_UNPACK (key),
|
return scm_cell (SCM_UNPACK (scm_cell (SCM_UNPACK (key),
|
||||||
SCM_UNPACK (value))),
|
SCM_UNPACK (value))),
|
||||||
SCM_UNPACK (alist));
|
SCM_UNPACK (alist));
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,7 +197,7 @@ CTYPES2UVECT (const CTYPE *data, long n)
|
||||||
n > 0 && n <= SCM_UVECTOR_MAX_LENGTH);
|
n > 0 && n <= SCM_UVECTOR_MAX_LENGTH);
|
||||||
v = scm_gc_malloc (n * sizeof (CTYPE), "uvect");
|
v = scm_gc_malloc (n * sizeof (CTYPE), "uvect");
|
||||||
memcpy (v, data, n * sizeof (CTYPE));
|
memcpy (v, data, n * sizeof (CTYPE));
|
||||||
return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE), (scm_t_bits) v);
|
return scm_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE), (scm_t_bits) v);
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ CTYPES2UVECT_OPTIONAL (const unsigned CTYPE *data, long n)
|
||||||
n > 0 && n <= SCM_UVECTOR_MAX_LENGTH);
|
n > 0 && n <= SCM_UVECTOR_MAX_LENGTH);
|
||||||
v = scm_gc_malloc (n * sizeof (unsigned CTYPE) * n, "uvect");
|
v = scm_gc_malloc (n * sizeof (unsigned CTYPE) * n, "uvect");
|
||||||
memcpy (v, data, n * sizeof (unsigned CTYPE));
|
memcpy (v, data, n * sizeof (unsigned CTYPE));
|
||||||
return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE_OPTIONAL),
|
return scm_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE_OPTIONAL),
|
||||||
(scm_t_bits) v);
|
(scm_t_bits) v);
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
|
@ -257,7 +257,7 @@ scm_call_with_new_thread (SCM argl)
|
||||||
/* Allocate thread locals. */
|
/* Allocate thread locals. */
|
||||||
root = scm_make_root (scm_root->handle);
|
root = scm_make_root (scm_root->handle);
|
||||||
/* Make thread. */
|
/* Make thread. */
|
||||||
thread = scm_alloc_cell (scm_tc16_thread, 0);
|
thread = scm_cell (scm_tc16_thread, 0);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
argl = scm_cons (thread, argl);
|
argl = scm_cons (thread, argl);
|
||||||
/* Note that we couldn't pass a pointer to argl as data since the
|
/* Note that we couldn't pass a pointer to argl as data since the
|
||||||
|
@ -343,7 +343,7 @@ scm_spawn_thread (scm_t_catch_body body, void *body_data,
|
||||||
/* Allocate thread locals. */
|
/* Allocate thread locals. */
|
||||||
root = scm_make_root (scm_root->handle);
|
root = scm_make_root (scm_root->handle);
|
||||||
/* Make thread. */
|
/* Make thread. */
|
||||||
thread = scm_alloc_cell (scm_tc16_thread, 0);
|
thread = scm_cell (scm_tc16_thread, 0);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
|
|
||||||
data->u.thread = thread;
|
data->u.thread = thread;
|
||||||
|
|
|
@ -539,7 +539,7 @@ SCM_DEFINE (scm_debug_object_p, "debug-object?", 1, 0, 0,
|
||||||
SCM
|
SCM
|
||||||
scm_make_debugobj (scm_t_debug_frame *frame)
|
scm_make_debugobj (scm_t_debug_frame *frame)
|
||||||
{
|
{
|
||||||
return scm_alloc_cell (scm_tc16_debugobj, (scm_t_bits) frame);
|
return scm_cell (scm_tc16_debugobj, (scm_t_bits) frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ scm_error_environment_immutable_location (const char *func, SCM env, SCM symbol)
|
||||||
SCM
|
SCM
|
||||||
scm_make_environment (void *type)
|
scm_make_environment (void *type)
|
||||||
{
|
{
|
||||||
return scm_alloc_cell (scm_tc16_environment, (scm_t_bits) type);
|
return scm_cell (scm_tc16_environment, (scm_t_bits) type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -662,9 +662,7 @@ struct core_environments_base {
|
||||||
static SCM
|
static SCM
|
||||||
core_environments_observe (SCM env, scm_environment_observer proc, SCM data, int weak_p)
|
core_environments_observe (SCM env, scm_environment_observer proc, SCM data, int weak_p)
|
||||||
{
|
{
|
||||||
SCM observer;
|
SCM observer = scm_double_cell (scm_tc16_observer,
|
||||||
|
|
||||||
observer = scm_alloc_double_cell (scm_tc16_observer,
|
|
||||||
SCM_UNPACK (env),
|
SCM_UNPACK (env),
|
||||||
SCM_UNPACK (data),
|
SCM_UNPACK (data),
|
||||||
(scm_t_bits) proc);
|
(scm_t_bits) proc);
|
||||||
|
|
|
@ -3836,8 +3836,7 @@ scm_closure (SCM code, SCM env)
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
SCM closcar = scm_cons (code, SCM_EOL);
|
SCM closcar = scm_cons (code, SCM_EOL);
|
||||||
z = scm_alloc_cell (SCM_UNPACK (closcar) + scm_tc3_closure,
|
z = scm_cell (SCM_UNPACK (closcar) + scm_tc3_closure, (scm_t_bits) env);
|
||||||
(scm_t_bits) env);
|
|
||||||
scm_remember_upto_here (closcar);
|
scm_remember_upto_here (closcar);
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
|
@ -436,7 +436,7 @@ scm_fdes_to_port (int fdes, char *mode, SCM name)
|
||||||
SCM_MISC_ERROR ("requested file mode not available on fdes", SCM_EOL);
|
SCM_MISC_ERROR ("requested file mode not available on fdes", SCM_EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
port = scm_alloc_cell (scm_tc16_fport, 0);
|
port = scm_cell (scm_tc16_fport, 0);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
pt = scm_add_to_port_table (port);
|
pt = scm_add_to_port_table (port);
|
||||||
SCM_SETPTAB_ENTRY (port, pt);
|
SCM_SETPTAB_ENTRY (port, pt);
|
||||||
|
|
|
@ -277,9 +277,9 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
|
||||||
# define SCM_HEAP_SEG_SIZE 32768L
|
# define SCM_HEAP_SEG_SIZE 32768L
|
||||||
#else
|
#else
|
||||||
# ifdef sequent
|
# ifdef sequent
|
||||||
# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_cell))
|
# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_t_cell))
|
||||||
# else
|
# else
|
||||||
# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_cell))
|
# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_t_cell))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
/* Make heap grow with factor 1.5 */
|
/* Make heap grow with factor 1.5 */
|
||||||
|
@ -287,7 +287,7 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
|
||||||
#define SCM_INIT_MALLOC_LIMIT 100000
|
#define SCM_INIT_MALLOC_LIMIT 100000
|
||||||
#define SCM_MTRIGGER_HYSTERESIS (SCM_INIT_MALLOC_LIMIT/10)
|
#define SCM_MTRIGGER_HYSTERESIS (SCM_INIT_MALLOC_LIMIT/10)
|
||||||
|
|
||||||
/* CELL_UP and CELL_DN are used by scm_init_heap_seg to find (scm_cell * span)
|
/* CELL_UP and CELL_DN are used by scm_init_heap_seg to find (scm_t_cell * span)
|
||||||
aligned inner bounds for allocated storage */
|
aligned inner bounds for allocated storage */
|
||||||
|
|
||||||
#ifdef PROT386
|
#ifdef PROT386
|
||||||
|
@ -299,12 +299,12 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
|
||||||
# define CELL_UP(p, span) (SCM_CELLPTR)(~(span) & ((long)(p)+(span)))
|
# define CELL_UP(p, span) (SCM_CELLPTR)(~(span) & ((long)(p)+(span)))
|
||||||
# define CELL_DN(p, span) (SCM_CELLPTR)(~(span) & (long)(p))
|
# define CELL_DN(p, span) (SCM_CELLPTR)(~(span) & (long)(p))
|
||||||
# else
|
# else
|
||||||
# define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & ((long)(p)+sizeof(scm_cell)*(span)-1L))
|
# define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_t_cell)*(span)-1L) & ((long)(p)+sizeof(scm_t_cell)*(span)-1L))
|
||||||
# define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & (long)(p))
|
# define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_t_cell)*(span)-1L) & (long)(p))
|
||||||
# endif /* UNICOS */
|
# endif /* UNICOS */
|
||||||
#endif /* PROT386 */
|
#endif /* PROT386 */
|
||||||
|
|
||||||
#define DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0)
|
#define DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0)
|
||||||
|
|
||||||
#define ALIGNMENT_SLACK(freelist) (SCM_GC_CARD_SIZE - 1)
|
#define ALIGNMENT_SLACK(freelist) (SCM_GC_CARD_SIZE - 1)
|
||||||
#define CLUSTER_SIZE_IN_BYTES(freelist) \
|
#define CLUSTER_SIZE_IN_BYTES(freelist) \
|
||||||
|
@ -1544,7 +1544,7 @@ gc_sweep_freelist_finish (scm_t_freelist *freelist)
|
||||||
|
|
||||||
#define NEXT_DATA_CELL(ptr, span) \
|
#define NEXT_DATA_CELL(ptr, span) \
|
||||||
do { \
|
do { \
|
||||||
scm_cell *nxt__ = CELL_UP ((char *) (ptr) + 1, (span)); \
|
scm_t_cell *nxt__ = CELL_UP ((char *) (ptr) + 1, (span)); \
|
||||||
(ptr) = (SCM_GC_IN_CARD_HEADERP (nxt__) ? \
|
(ptr) = (SCM_GC_IN_CARD_HEADERP (nxt__) ? \
|
||||||
CELL_UP (SCM_GC_CELL_CARD (nxt__) + SCM_GC_CARD_N_HEADER_CELLS, span) \
|
CELL_UP (SCM_GC_CELL_CARD (nxt__) + SCM_GC_CARD_N_HEADER_CELLS, span) \
|
||||||
: nxt__); \
|
: nxt__); \
|
||||||
|
@ -2201,9 +2201,9 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
|
||||||
NEXT_DATA_CELL (ptr, span);
|
NEXT_DATA_CELL (ptr, span);
|
||||||
while (ptr < seg_end)
|
while (ptr < seg_end)
|
||||||
{
|
{
|
||||||
scm_cell *nxt = ptr;
|
scm_t_cell *nxt = ptr;
|
||||||
scm_cell *prv = NULL;
|
scm_t_cell *prv = NULL;
|
||||||
scm_cell *last_card = NULL;
|
scm_t_cell *last_card = NULL;
|
||||||
int n_data_cells = (SCM_GC_CARD_N_DATA_CELLS / span) * SCM_CARDS_PER_CLUSTER - 1;
|
int n_data_cells = (SCM_GC_CARD_N_DATA_CELLS / span) * SCM_CARDS_PER_CLUSTER - 1;
|
||||||
NEXT_DATA_CELL(nxt, span);
|
NEXT_DATA_CELL(nxt, span);
|
||||||
|
|
||||||
|
@ -2216,7 +2216,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
|
||||||
|
|
||||||
while (n_data_cells--)
|
while (n_data_cells--)
|
||||||
{
|
{
|
||||||
scm_cell *card = SCM_GC_CELL_CARD (ptr);
|
scm_t_cell *card = SCM_GC_CELL_CARD (ptr);
|
||||||
SCM scmptr = PTR2SCM (ptr);
|
SCM scmptr = PTR2SCM (ptr);
|
||||||
nxt = ptr;
|
nxt = ptr;
|
||||||
NEXT_DATA_CELL (nxt, span);
|
NEXT_DATA_CELL (nxt, span);
|
||||||
|
@ -2239,7 +2239,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
|
||||||
|
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
{
|
{
|
||||||
scm_cell *ref = seg_end;
|
scm_t_cell *ref = seg_end;
|
||||||
NEXT_DATA_CELL (ref, span);
|
NEXT_DATA_CELL (ref, span);
|
||||||
if (ref != ptr)
|
if (ref != ptr)
|
||||||
/* [cmm] looks like the segment size doesn't divide cleanly by
|
/* [cmm] looks like the segment size doesn't divide cleanly by
|
||||||
|
@ -2344,7 +2344,7 @@ alloc_some_heap (scm_t_freelist *freelist, policy_on_error error_policy)
|
||||||
#endif
|
#endif
|
||||||
if (len < min_cells)
|
if (len < min_cells)
|
||||||
len = min_cells + freelist->cluster_size;
|
len = min_cells + freelist->cluster_size;
|
||||||
len *= sizeof (scm_cell);
|
len *= sizeof (scm_t_cell);
|
||||||
/* force new sampling */
|
/* force new sampling */
|
||||||
freelist->collected = LONG_MAX;
|
freelist->collected = LONG_MAX;
|
||||||
}
|
}
|
||||||
|
@ -2831,18 +2831,18 @@ SCM
|
||||||
scm_deprecated_newcell (void)
|
scm_deprecated_newcell (void)
|
||||||
{
|
{
|
||||||
scm_c_issue_deprecation_warning
|
scm_c_issue_deprecation_warning
|
||||||
("SCM_NEWCELL is deprecated. Use `scm_alloc_cell' instead.\n");
|
("SCM_NEWCELL is deprecated. Use `scm_cell' instead.\n");
|
||||||
|
|
||||||
return scm_alloc_cell (scm_tc16_allocated, 0);
|
return scm_cell (scm_tc16_allocated, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
scm_deprecated_newcell2 (void)
|
scm_deprecated_newcell2 (void)
|
||||||
{
|
{
|
||||||
scm_c_issue_deprecation_warning
|
scm_c_issue_deprecation_warning
|
||||||
("SCM_NEWCELL2 is deprecated. Use `scm_alloc_double_cell' instead.\n");
|
("SCM_NEWCELL2 is deprecated. Use `scm_double_cell' instead.\n");
|
||||||
|
|
||||||
return scm_alloc_double_cell (scm_tc16_allocated, 0, 0, 0);
|
return scm_double_cell (scm_tc16_allocated, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SCM_ENABLE_DEPRECATED == 1 */
|
#endif /* SCM_ENABLE_DEPRECATED == 1 */
|
||||||
|
|
|
@ -52,24 +52,24 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct scm_cell
|
typedef struct scm_t_cell
|
||||||
{
|
{
|
||||||
scm_t_bits word_0;
|
scm_t_bits word_0;
|
||||||
scm_t_bits word_1;
|
scm_t_bits word_1;
|
||||||
} scm_cell;
|
} scm_t_cell;
|
||||||
|
|
||||||
|
|
||||||
/* SCM_CELLPTR is a pointer to a cons cell which may be compared or
|
/* SCM_CELLPTR is a pointer to a cons cell which may be compared or
|
||||||
* differenced.
|
* differenced.
|
||||||
*/
|
*/
|
||||||
typedef scm_cell * SCM_CELLPTR;
|
typedef scm_t_cell * SCM_CELLPTR;
|
||||||
|
|
||||||
|
|
||||||
/* Cray machines have pointers that are incremented once for each word,
|
/* Cray machines have pointers that are incremented once for each word,
|
||||||
* rather than each byte, the 3 most significant bits encode the byte
|
* rather than each byte, the 3 most significant bits encode the byte
|
||||||
* within the word. The following macros deal with this by storing the
|
* within the word. The following macros deal with this by storing the
|
||||||
* native Cray pointers like the ones that looks like scm expects. This
|
* native Cray pointers like the ones that looks like scm expects. This
|
||||||
* is done for any pointers that might appear in the car of a scm_cell,
|
* is done for any pointers that might appear in the car of a scm_t_cell,
|
||||||
* pointers to scm_vector elts, functions, &c are not munged.
|
* pointers to scm_vector elts, functions, &c are not munged.
|
||||||
*/
|
*/
|
||||||
#ifdef _UNICOS
|
#ifdef _UNICOS
|
||||||
|
@ -83,14 +83,14 @@ typedef scm_cell * SCM_CELLPTR;
|
||||||
#define SCM_GC_CARD_N_HEADER_CELLS 1
|
#define SCM_GC_CARD_N_HEADER_CELLS 1
|
||||||
#define SCM_GC_CARD_N_CELLS 256
|
#define SCM_GC_CARD_N_CELLS 256
|
||||||
|
|
||||||
#define SCM_GC_CARD_SIZE (SCM_GC_CARD_N_CELLS * sizeof (scm_cell))
|
#define SCM_GC_CARD_SIZE (SCM_GC_CARD_N_CELLS * sizeof (scm_t_cell))
|
||||||
#define SCM_GC_CARD_N_DATA_CELLS (SCM_GC_CARD_N_CELLS - SCM_GC_CARD_N_HEADER_CELLS)
|
#define SCM_GC_CARD_N_DATA_CELLS (SCM_GC_CARD_N_CELLS - SCM_GC_CARD_N_HEADER_CELLS)
|
||||||
|
|
||||||
#define SCM_GC_CARD_BVEC_SIZE_IN_LIMBS \
|
#define SCM_GC_CARD_BVEC_SIZE_IN_LIMBS \
|
||||||
((SCM_GC_CARD_N_CELLS + SCM_C_BVEC_LIMB_BITS - 1) / SCM_C_BVEC_LIMB_BITS)
|
((SCM_GC_CARD_N_CELLS + SCM_C_BVEC_LIMB_BITS - 1) / SCM_C_BVEC_LIMB_BITS)
|
||||||
|
|
||||||
#define SCM_GC_IN_CARD_HEADERP(x) \
|
#define SCM_GC_IN_CARD_HEADERP(x) \
|
||||||
SCM_PTR_LT ((scm_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS)
|
SCM_PTR_LT ((scm_t_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS)
|
||||||
|
|
||||||
#define SCM_GC_CARD_BVEC(card) ((scm_t_c_bvec_limb *) ((card)->word_0))
|
#define SCM_GC_CARD_BVEC(card) ((scm_t_c_bvec_limb *) ((card)->word_0))
|
||||||
#define SCM_GC_SET_CARD_BVEC(card, bvec) \
|
#define SCM_GC_SET_CARD_BVEC(card, bvec) \
|
||||||
|
|
|
@ -149,7 +149,7 @@ gh_doubles2scm (const double *d, long n)
|
||||||
static SCM
|
static SCM
|
||||||
makvect (char *m, size_t len, int type)
|
makvect (char *m, size_t len, int type)
|
||||||
{
|
{
|
||||||
return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (len, type), (scm_t_bits) m);
|
return scm_cell (SCM_MAKE_UVECTOR_TAG (len, type), (scm_t_bits) m);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
|
|
@ -1306,7 +1306,7 @@ wrap_init (SCM class, SCM *m, long n)
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
m[i] = SCM_GOOPS_UNBOUND;
|
m[i] = SCM_GOOPS_UNBOUND;
|
||||||
|
|
||||||
return scm_alloc_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (class))
|
return scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (class))
|
||||||
| scm_tc3_struct),
|
| scm_tc3_struct),
|
||||||
(scm_t_bits) m, 0, 0);
|
(scm_t_bits) m, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -2580,7 +2580,7 @@ scm_add_slot (SCM class, char *slot_name, SCM slot_class,
|
||||||
SCM
|
SCM
|
||||||
scm_wrap_object (SCM class, void *data)
|
scm_wrap_object (SCM class, void *data)
|
||||||
{
|
{
|
||||||
return scm_alloc_double_cell (SCM_UNPACK (SCM_CDR (class)) | scm_tc3_struct,
|
return scm_double_cell (SCM_UNPACK (SCM_CDR (class)) | scm_tc3_struct,
|
||||||
(scm_t_bits) data,
|
(scm_t_bits) data,
|
||||||
0, 0);
|
0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
#ifdef HAVE_INLINE
|
#ifdef HAVE_INLINE
|
||||||
|
|
||||||
static inline SCM
|
static inline SCM
|
||||||
scm_alloc_cell (scm_t_bits car, scm_t_bits cdr)
|
scm_cell (scm_t_bits car, scm_t_bits cdr)
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ scm_alloc_cell (scm_t_bits car, scm_t_bits cdr)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline SCM
|
static inline SCM
|
||||||
scm_alloc_double_cell (scm_t_bits car, scm_t_bits cbr,
|
scm_double_cell (scm_t_bits car, scm_t_bits cbr,
|
||||||
scm_t_bits ccr, scm_t_bits cdr)
|
scm_t_bits ccr, scm_t_bits cdr)
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
|
@ -153,8 +153,8 @@ scm_alloc_double_cell (scm_t_bits car, scm_t_bits cbr,
|
||||||
|
|
||||||
#else /* !HAVE_INLINE */
|
#else /* !HAVE_INLINE */
|
||||||
|
|
||||||
SCM_API SCM scm_alloc_cell (scm_t_bits car, scm_t_bits cdr);
|
SCM_API SCM scm_cell (scm_t_bits car, scm_t_bits cdr);
|
||||||
SCM_API SCM scm_alloc_double_cell (scm_t_bits car, scm_t_bits cbr,
|
SCM_API SCM scm_double_cell (scm_t_bits car, scm_t_bits cbr,
|
||||||
scm_t_bits ccr, scm_t_bits cdr);
|
scm_t_bits ccr, scm_t_bits cdr);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
|
|
||||||
#define SCM_I_CONS(cell,x,y) \
|
#define SCM_I_CONS(cell,x,y) \
|
||||||
do { \
|
do { \
|
||||||
cell = scm_alloc_cell ((scm_t_bits)x, (scm_t_bits)y); \
|
cell = scm_cell ((scm_t_bits)x, (scm_t_bits)y); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
|
|
@ -32,7 +32,7 @@ SCM
|
||||||
FLOAT2NUM (FTYPE n)
|
FLOAT2NUM (FTYPE n)
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
z = scm_alloc_double_cell (scm_tc16_real, 0, 0, 0);
|
z = scm_double_cell (scm_tc16_real, 0, 0, 0);
|
||||||
SCM_REAL_VALUE (z) = n;
|
SCM_REAL_VALUE (z) = n;
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1390,7 +1390,7 @@ scm_i_mkbig (size_t nlen, int sign)
|
||||||
|
|
||||||
base = scm_gc_malloc (nlen * sizeof (SCM_BIGDIG), s_bignum);
|
base = scm_gc_malloc (nlen * sizeof (SCM_BIGDIG), s_bignum);
|
||||||
|
|
||||||
v = scm_alloc_cell (SCM_MAKE_BIGNUM_TAG (nlen, sign), (scm_t_bits) base);
|
v = scm_cell (SCM_MAKE_BIGNUM_TAG (nlen, sign), (scm_t_bits) base);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2827,7 +2827,7 @@ SCM
|
||||||
scm_make_real (double x)
|
scm_make_real (double x)
|
||||||
{
|
{
|
||||||
SCM z;
|
SCM z;
|
||||||
z = scm_alloc_double_cell (scm_tc16_real, 0, 0, 0);
|
z = scm_double_cell (scm_tc16_real, 0, 0, 0);
|
||||||
SCM_REAL_VALUE (z) = x;
|
SCM_REAL_VALUE (z) = x;
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ SCM_DEFINE (scm_cons, "cons", 2, 0, 0,
|
||||||
"sense of @code{eq?}) from every previously existing object.")
|
"sense of @code{eq?}) from every previously existing object.")
|
||||||
#define FUNC_NAME s_scm_cons
|
#define FUNC_NAME s_scm_cons
|
||||||
{
|
{
|
||||||
return scm_alloc_cell (SCM_UNPACK (x), SCM_UNPACK (y));
|
return scm_cell (SCM_UNPACK (x), SCM_UNPACK (y));
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
|
@ -1531,7 +1531,7 @@ scm_void_port (char *mode_str)
|
||||||
SCM answer;
|
SCM answer;
|
||||||
scm_t_port * pt;
|
scm_t_port * pt;
|
||||||
|
|
||||||
answer = scm_alloc_cell (scm_tc16_void_port, 0);
|
answer = scm_cell (scm_tc16_void_port, 0);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
mode_bits = scm_mode_bits (mode_str);
|
mode_bits = scm_mode_bits (mode_str);
|
||||||
pt = scm_add_to_port_table (answer);
|
pt = scm_add_to_port_table (answer);
|
||||||
|
|
|
@ -85,7 +85,7 @@ scm_c_make_subr (const char *name, long type, SCM (*fcn) ())
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = scm_subr_table_size;
|
entry = scm_subr_table_size;
|
||||||
z = scm_alloc_cell ((entry << 8) + type, (scm_t_bits) fcn);
|
z = scm_cell ((entry << 8) + type, (scm_t_bits) fcn);
|
||||||
scm_subr_table[entry].handle = z;
|
scm_subr_table[entry].handle = z;
|
||||||
scm_subr_table[entry].name = scm_str2symbol (name);
|
scm_subr_table[entry].name = scm_str2symbol (name);
|
||||||
scm_subr_table[entry].generic = 0;
|
scm_subr_table[entry].generic = 0;
|
||||||
|
@ -160,7 +160,7 @@ scm_makcclo (SCM proc, size_t len)
|
||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < len; ++i)
|
||||||
base [i] = SCM_UNPACK (SCM_UNSPECIFIED);
|
base [i] = SCM_UNPACK (SCM_UNSPECIFIED);
|
||||||
|
|
||||||
s = scm_alloc_cell (SCM_MAKE_CCLO_TAG (len), (scm_t_bits) base);
|
s = scm_cell (SCM_MAKE_CCLO_TAG (len), (scm_t_bits) base);
|
||||||
SCM_SET_CCLO_SUBR (s, proc);
|
SCM_SET_CCLO_SUBR (s, proc);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ SCM_DEFINE (scm_make_procedure_with_setter, "make-procedure-with-setter", 2, 0,
|
||||||
{
|
{
|
||||||
SCM_VALIDATE_PROC (1, procedure);
|
SCM_VALIDATE_PROC (1, procedure);
|
||||||
SCM_VALIDATE_PROC (2, setter);
|
SCM_VALIDATE_PROC (2, setter);
|
||||||
return scm_alloc_double_cell (scm_tc7_pws,
|
return scm_double_cell (scm_tc7_pws,
|
||||||
SCM_UNPACK (procedure),
|
SCM_UNPACK (procedure),
|
||||||
SCM_UNPACK (setter), 0);
|
SCM_UNPACK (setter), 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -462,7 +462,7 @@ scm_make_smob (scm_t_bits tc)
|
||||||
scm_t_bits data = (size > 0
|
scm_t_bits data = (size > 0
|
||||||
? (scm_t_bits) scm_gc_malloc (size, SCM_SMOBNAME (n))
|
? (scm_t_bits) scm_gc_malloc (size, SCM_SMOBNAME (n))
|
||||||
: 0);
|
: 0);
|
||||||
return scm_alloc_cell (tc, data);
|
return scm_cell (tc, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ typedef struct scm_smob_descriptor
|
||||||
|
|
||||||
#define SCM_NEWSMOB(z, tc, data) \
|
#define SCM_NEWSMOB(z, tc, data) \
|
||||||
do { \
|
do { \
|
||||||
z = scm_alloc_cell ((tc), (scm_t_bits) (data)); \
|
z = scm_cell ((tc), (scm_t_bits) (data)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define SCM_RETURN_NEWSMOB(tc, data) \
|
#define SCM_RETURN_NEWSMOB(tc, data) \
|
||||||
|
@ -83,8 +83,7 @@ do { \
|
||||||
|
|
||||||
#define SCM_NEWSMOB2(z, tc, data1, data2) \
|
#define SCM_NEWSMOB2(z, tc, data1, data2) \
|
||||||
do { \
|
do { \
|
||||||
z = scm_alloc_double_cell ((tc), (scm_t_bits)(data1), \
|
z = scm_double_cell ((tc), (scm_t_bits)(data1), (scm_t_bits)(data2), 0); \
|
||||||
(scm_t_bits)(data2), 0); \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define SCM_RETURN_NEWSMOB2(tc, data1, data2) \
|
#define SCM_RETURN_NEWSMOB2(tc, data1, data2) \
|
||||||
|
@ -95,7 +94,7 @@ do { \
|
||||||
|
|
||||||
#define SCM_NEWSMOB3(z, tc, data1, data2, data3) \
|
#define SCM_NEWSMOB3(z, tc, data1, data2, data3) \
|
||||||
do { \
|
do { \
|
||||||
z = scm_alloc_double_cell ((tc), (scm_t_bits)(data1), \
|
z = scm_double_cell ((tc), (scm_t_bits)(data1), \
|
||||||
(scm_t_bits)(data2), (scm_t_bits)(data3)); \
|
(scm_t_bits)(data2), (scm_t_bits)(data3)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
|
@ -132,7 +132,7 @@ scm_take_str (char *s, size_t len)
|
||||||
|
|
||||||
SCM_ASSERT_RANGE (2, scm_ulong2num (len), len <= SCM_STRING_MAX_LENGTH);
|
SCM_ASSERT_RANGE (2, scm_ulong2num (len), len <= SCM_STRING_MAX_LENGTH);
|
||||||
|
|
||||||
answer = scm_alloc_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) s);
|
answer = scm_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) s);
|
||||||
scm_gc_register_collectable_memory (s, len+1, "string");
|
scm_gc_register_collectable_memory (s, len+1, "string");
|
||||||
|
|
||||||
return answer;
|
return answer;
|
||||||
|
@ -194,7 +194,7 @@ scm_allocate_string (size_t len)
|
||||||
mem = (char *) scm_gc_malloc (len + 1, "string");
|
mem = (char *) scm_gc_malloc (len + 1, "string");
|
||||||
mem[len] = 0;
|
mem[len] = 0;
|
||||||
|
|
||||||
s = scm_alloc_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) mem);
|
s = scm_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) mem);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,7 +279,7 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller)
|
||||||
scm_out_of_range (caller, pos);
|
scm_out_of_range (caller, pos);
|
||||||
if (!((modes & SCM_WRTNG) || (modes & SCM_RDNG)))
|
if (!((modes & SCM_WRTNG) || (modes & SCM_RDNG)))
|
||||||
scm_misc_error ("scm_mkstrport", "port must read or write", SCM_EOL);
|
scm_misc_error ("scm_mkstrport", "port must read or write", SCM_EOL);
|
||||||
z = scm_alloc_cell (scm_tc16_strport, 0);
|
z = scm_cell (scm_tc16_strport, 0);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
pt = scm_add_to_port_table (z);
|
pt = scm_add_to_port_table (z);
|
||||||
SCM_SET_CELL_TYPE (z, scm_tc16_strport | modes);
|
SCM_SET_CELL_TYPE (z, scm_tc16_strport | modes);
|
||||||
|
|
|
@ -460,7 +460,7 @@ SCM_DEFINE (scm_make_struct, "make-struct", 2, 0, 1,
|
||||||
data = scm_alloc_struct (basic_size + tail_elts,
|
data = scm_alloc_struct (basic_size + tail_elts,
|
||||||
scm_struct_n_extra_words,
|
scm_struct_n_extra_words,
|
||||||
"struct");
|
"struct");
|
||||||
handle = scm_alloc_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (vtable))
|
handle = scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (vtable))
|
||||||
+ scm_tc3_struct),
|
+ scm_tc3_struct),
|
||||||
(scm_t_bits) data, 0, 0);
|
(scm_t_bits) data, 0, 0);
|
||||||
scm_struct_init (handle, layout, data, tail_elts, init);
|
scm_struct_init (handle, layout, data, tail_elts, init);
|
||||||
|
@ -539,7 +539,7 @@ SCM_DEFINE (scm_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1,
|
||||||
data = scm_alloc_struct (basic_size + tail_elts,
|
data = scm_alloc_struct (basic_size + tail_elts,
|
||||||
scm_struct_n_extra_words,
|
scm_struct_n_extra_words,
|
||||||
"struct");
|
"struct");
|
||||||
handle = scm_alloc_double_cell ((scm_t_bits) data + scm_tc3_struct,
|
handle = scm_double_cell ((scm_t_bits) data + scm_tc3_struct,
|
||||||
(scm_t_bits) data, 0, 0);
|
(scm_t_bits) data, 0, 0);
|
||||||
data [scm_vtable_index_layout] = SCM_UNPACK (layout);
|
data [scm_vtable_index_layout] = SCM_UNPACK (layout);
|
||||||
scm_struct_init (handle, layout, data, tail_elts, scm_cons (layout, init));
|
scm_struct_init (handle, layout, data, tail_elts, scm_cons (layout, init));
|
||||||
|
|
|
@ -125,12 +125,11 @@ scm_mem2symbol (const char *name, size_t len)
|
||||||
SCM cell;
|
SCM cell;
|
||||||
SCM slot;
|
SCM slot;
|
||||||
|
|
||||||
symbol = scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len),
|
symbol = scm_double_cell (SCM_MAKE_SYMBOL_TAG (len),
|
||||||
(scm_t_bits) scm_gc_strndup (name, len,
|
(scm_t_bits) scm_gc_strndup (name, len,
|
||||||
"symbol"),
|
"symbol"),
|
||||||
raw_hash,
|
raw_hash,
|
||||||
SCM_UNPACK (scm_cons (SCM_BOOL_F,
|
SCM_UNPACK (scm_cons (SCM_BOOL_F, SCM_EOL)));
|
||||||
SCM_EOL)));
|
|
||||||
|
|
||||||
slot = SCM_VELTS (symbols) [hash];
|
slot = SCM_VELTS (symbols) [hash];
|
||||||
cell = scm_cons (symbol, SCM_UNDEFINED);
|
cell = scm_cons (symbol, SCM_UNDEFINED);
|
||||||
|
@ -146,12 +145,11 @@ scm_mem2uninterned_symbol (const char *name, size_t len)
|
||||||
size_t raw_hash = (scm_string_hash ((const unsigned char *) name, len)/2
|
size_t raw_hash = (scm_string_hash ((const unsigned char *) name, len)/2
|
||||||
+ SCM_T_BITS_MAX/2 + 1);
|
+ SCM_T_BITS_MAX/2 + 1);
|
||||||
|
|
||||||
return scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len),
|
return scm_double_cell (SCM_MAKE_SYMBOL_TAG (len),
|
||||||
(scm_t_bits) scm_gc_strndup (name, len,
|
(scm_t_bits) scm_gc_strndup (name, len,
|
||||||
"symbol"),
|
"symbol"),
|
||||||
raw_hash,
|
raw_hash,
|
||||||
SCM_UNPACK (scm_cons (SCM_BOOL_F,
|
SCM_UNPACK (scm_cons (SCM_BOOL_F, SCM_EOL)));
|
||||||
SCM_EOL)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
|
|
@ -533,7 +533,7 @@ SCM_API char *scm_isymnames[]; /* defined in print.c */
|
||||||
|
|
||||||
#if (SCM_ENABLE_DEPRECATED == 1)
|
#if (SCM_ENABLE_DEPRECATED == 1)
|
||||||
|
|
||||||
#define SCM_CELLP(x) (((sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0)
|
#define SCM_CELLP(x) (((sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0)
|
||||||
#define SCM_NCELLP(x) (!SCM_CELLP (x))
|
#define SCM_NCELLP(x) (!SCM_CELLP (x))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -170,11 +170,11 @@ scm_make_uve (long k, SCM prot)
|
||||||
SCM_ASSERT_RANGE (1,
|
SCM_ASSERT_RANGE (1,
|
||||||
scm_long2num (k), k <= SCM_BITVECTOR_MAX_LENGTH);
|
scm_long2num (k), k <= SCM_BITVECTOR_MAX_LENGTH);
|
||||||
i = sizeof (long) * ((k + SCM_LONG_BIT - 1) / SCM_LONG_BIT);
|
i = sizeof (long) * ((k + SCM_LONG_BIT - 1) / SCM_LONG_BIT);
|
||||||
v = scm_alloc_cell (SCM_MAKE_BITVECTOR_TAG (k),
|
v = scm_cell (SCM_MAKE_BITVECTOR_TAG (k),
|
||||||
(scm_t_bits) scm_gc_malloc (i, "vector"));
|
(scm_t_bits) scm_gc_malloc (i, "vector"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
v = scm_alloc_cell (SCM_MAKE_BITVECTOR_TAG (0), 0);
|
v = scm_cell (SCM_MAKE_BITVECTOR_TAG (0), 0);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
else if (SCM_CHARP (prot) && (SCM_CHAR (prot) == '\0'))
|
else if (SCM_CHARP (prot) && (SCM_CHAR (prot) == '\0'))
|
||||||
|
@ -239,7 +239,7 @@ scm_make_uve (long k, SCM prot)
|
||||||
|
|
||||||
SCM_ASSERT_RANGE (1, scm_long2num (k), k <= SCM_UVECTOR_MAX_LENGTH);
|
SCM_ASSERT_RANGE (1, scm_long2num (k), k <= SCM_UVECTOR_MAX_LENGTH);
|
||||||
|
|
||||||
return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (k, type),
|
return scm_cell (SCM_MAKE_UVECTOR_TAG (k, type),
|
||||||
(scm_t_bits) scm_gc_malloc (i, "vector"));
|
(scm_t_bits) scm_gc_malloc (i, "vector"));
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
|
@ -68,7 +68,7 @@ scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
static SCM
|
static SCM
|
||||||
make_variable (SCM init)
|
make_variable (SCM init)
|
||||||
{
|
{
|
||||||
return scm_alloc_cell (scm_tc7_variable, SCM_UNPACK (init));
|
return scm_cell (scm_tc7_variable, SCM_UNPACK (init));
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_DEFINE (scm_make_variable, "make-variable", 1, 0, 0,
|
SCM_DEFINE (scm_make_variable, "make-variable", 1, 0, 0,
|
||||||
|
|
|
@ -215,8 +215,7 @@ scm_c_make_vector (unsigned long int k, SCM fill)
|
||||||
else
|
else
|
||||||
base = NULL;
|
base = NULL;
|
||||||
|
|
||||||
v = scm_alloc_cell (SCM_MAKE_VECTOR_TAG (k, scm_tc7_vector),
|
v = scm_cell (SCM_MAKE_VECTOR_TAG (k, scm_tc7_vector), (scm_t_bits) base);
|
||||||
(scm_t_bits) base);
|
|
||||||
scm_remember_upto_here_1 (fill);
|
scm_remember_upto_here_1 (fill);
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
|
|
|
@ -189,7 +189,7 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0,
|
||||||
SCM z;
|
SCM z;
|
||||||
SCM_VALIDATE_VECTOR_LEN (1,pv,5);
|
SCM_VALIDATE_VECTOR_LEN (1,pv,5);
|
||||||
SCM_VALIDATE_STRING (2, modes);
|
SCM_VALIDATE_STRING (2, modes);
|
||||||
z = scm_alloc_cell (scm_tc16_sfport, 0);
|
z = scm_cell (scm_tc16_sfport, 0);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
pt = scm_add_to_port_table (z);
|
pt = scm_add_to_port_table (z);
|
||||||
scm_port_non_buffer (pt);
|
scm_port_non_buffer (pt);
|
||||||
|
|
|
@ -84,8 +84,7 @@ allocate_weak_vector (scm_t_bits type, SCM size, SCM fill, const char* caller)
|
||||||
base = scm_gc_malloc (c_size * sizeof (scm_t_bits), "weak vector");
|
base = scm_gc_malloc (c_size * sizeof (scm_t_bits), "weak vector");
|
||||||
for (j = 0; j != c_size; ++j)
|
for (j = 0; j != c_size; ++j)
|
||||||
base[j] = SCM_UNPACK (fill);
|
base[j] = SCM_UNPACK (fill);
|
||||||
v = scm_alloc_double_cell (SCM_MAKE_VECTOR_TAG (c_size,
|
v = scm_double_cell (SCM_MAKE_VECTOR_TAG (c_size, scm_tc7_wvect),
|
||||||
scm_tc7_wvect),
|
|
||||||
(scm_t_bits) base,
|
(scm_t_bits) base,
|
||||||
type,
|
type,
|
||||||
SCM_UNPACK (SCM_EOL));
|
SCM_UNPACK (SCM_EOL));
|
||||||
|
@ -93,8 +92,7 @@ allocate_weak_vector (scm_t_bits type, SCM size, SCM fill, const char* caller)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
v = scm_alloc_double_cell (SCM_MAKE_VECTOR_TAG (0,
|
v = scm_double_cell (SCM_MAKE_VECTOR_TAG (0, scm_tc7_wvect),
|
||||||
scm_tc7_wvect),
|
|
||||||
(scm_t_bits) NULL,
|
(scm_t_bits) NULL,
|
||||||
type,
|
type,
|
||||||
SCM_UNPACK (SCM_EOL));
|
SCM_UNPACK (SCM_EOL));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue