int ndim, i, k;
SCM_VALIDATE_REST_ARGUMENT (args);
- SCM_ASSERT (SCM_NIMP (ra), ra, SCM_ARG1, FUNC_NAME);
+ SCM_ASSERT (SCM_HEAP_OBJECT_P (ra), ra, SCM_ARG1, FUNC_NAME);
if (scm_is_generalized_vector (ra))
{
if (scm_is_true (src))
return src;
- switch (SCM_TYP7 (proc)) {
- case scm_tcs_struct:
- if (!SCM_STRUCT_APPLICABLE_P (proc)
- || SCM_IMP (SCM_STRUCT_PROCEDURE (proc)))
- break;
- proc = SCM_STRUCT_PROCEDURE (proc);
+ if (SCM_STRUCTP (proc) && SCM_STRUCT_APPLICABLE_P (proc)
+ && SCM_HEAP_OBJECT_P ((proc = SCM_STRUCT_PROCEDURE (proc))))
continue;
- default:
- break;
- }
}
while (0);
SCM ret;
ret = scm_from_pointer ((void*) SCM_UNPACK (scm), NULL);
- if (SCM_NIMP (ret))
+ if (SCM_HEAP_OBJECT_P (ret))
register_weak_reference (ret, scm);
return ret;
ans = scm_read (gdb_input_port);
if (SCM_GC_P)
{
- if (SCM_NIMP (ans))
+ if (SCM_HEAP_OBJECT_P (ans))
{
SEND_STRING ("Non-immediate created during gc. Memory may be trashed.");
status = -1;
}
gdb_result = ans;
/* Protect answer from future GC (FIXME: still needed with BDW-GC?) */
- if (SCM_NIMP (ans))
+ if (SCM_HEAP_OBJECT_P (ans))
scm_permanent_object (ans);
exit:
remark_port (gdb_input_port);
{
t_guardian *g = GUARDIAN_DATA (guardian);
- if (SCM_NIMP (obj))
+ if (SCM_HEAP_OBJECT_P (obj))
{
/* Register a finalizer and pass a pair as the ``client data''
argument. The pair contains in its car `#f' or a pair describing a
while (! SCM_UNBNDP (elt))
{
#if (SCM_DEBUG_CELL_ACCESSES == 1)
- if (SCM_NIMP (elt))
+ if (SCM_HEAP_OBJECT_P (elt))
SCM_VALIDATE_CELL(elt, 0);
#endif
*pos = scm_cons (elt, SCM_EOL);
{
SCM var;
- if (SCM_NIMP (proc))
+ if (SCM_HEAP_OBJECT_P (proc))
{
if (SCM_EVAL_CLOSURE_P (proc))
{
-/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008, 2009, 2010 Free Software Foundation
+/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008, 2009, 2010, 2011 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
{
SCM old = SCM_PACK (options[i].val);
SCM new = SCM_PACK (flags[i]);
- if (!SCM_IMP (old))
+ if (SCM_HEAP_OBJECT_P (old))
protected_objects = scm_delq1_x (old, protected_objects);
- if (!SCM_IMP (new))
+ if (SCM_HEAP_OBJECT_P (new))
protected_objects = scm_cons (new, protected_objects);
}
options[i].val = flags[i];
mark_stack_ptr = SCM_I_CURRENT_THREAD->current_mark_stack_ptr;
- if (SCM_NIMP (obj))
+ if (SCM_HEAP_OBJECT_P (obj))
/* Mark the returned object. */
mark_stack_ptr = GC_MARK_AND_PUSH (SCM2PTR (obj),
mark_stack_ptr,
#define CURRENT_MARK_LIMIT \
((struct GC_ms_entry *)(SCM_I_CURRENT_THREAD->current_mark_stack_limit))
- if (SCM_NIMP (o))
+ if (SCM_HEAP_OBJECT_P (o))
{
/* At this point, the `current_mark_*' fields of the current thread
must be defined (they are set in `smob_mark ()'). */
* since for a SCM variable it is known that tc1==0. */
#define SCM_IMP(x) (6 & SCM_UNPACK (x))
#define SCM_NIMP(x) (!SCM_IMP (x))
+#define SCM_HEAP_OBJECT_P(x) (SCM_NIMP (x))
/* Checking if a SCM variable holds an immediate integer: See numbers.h for
* the definition of the following macros: SCM_I_FIXNUM_BIT,
#ifndef SCM_VALIDATE_H
#define SCM_VALIDATE_H
-/* Copyright (C) 1999,2000,2001, 2002, 2004, 2006, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1999,2000,2001, 2002, 2004, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
#define SCM_VALIDATE_ARRAY(pos, v) \
do { \
- SCM_ASSERT (!SCM_IMP (v) \
+ SCM_ASSERT (SCM_HEAP_OBJECT_P (v) \
&& scm_is_true (scm_array_p (v, SCM_UNDEFINED)), \
v, pos, FUNC_NAME); \
} while (0)
to->hash = copy.hash;
to->key = copy.key;
- if (copy.key && SCM_NIMP (SCM_PACK (copy.key)))
+ if (copy.key && SCM_HEAP_OBJECT_P (SCM_PACK (copy.key)))
{
GC_unregister_disappearing_link ((GC_PTR) &from->key);
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &to->key,
new_entries[new_k].hash = copy.hash;
new_entries[new_k].key = copy.key;
- if (SCM_NIMP (SCM_PACK (copy.key)))
+ if (SCM_HEAP_OBJECT_P (SCM_PACK (copy.key)))
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &new_entries[new_k].key,
(GC_PTR) new_entries[new_k].key);
}
entries[k].hash = hash;
entries[k].key = SCM_UNPACK (obj);
- if (SCM_NIMP (obj))
+ if (SCM_HEAP_OBJECT_P (obj))
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &entries[k].key,
(GC_PTR) SCM2PTR (obj));
entries[k].hash = 0;
entries[k].key = 0;
- if (SCM_NIMP (SCM_PACK (copy.key)))
+ if (SCM_HEAP_OBJECT_P (SCM_PACK (copy.key)))
GC_unregister_disappearing_link ((GC_PTR) &entries[k].key);
if (--set->n_items < set->lower)
SCM k, SCM v,
scm_t_weak_table_kind kind)
{
- if (SCM_UNPACK (k) && SCM_NIMP (k)
+ if (SCM_UNPACK (k) && SCM_HEAP_OBJECT_P (k)
&& (kind == SCM_WEAK_TABLE_KIND_KEY
|| kind == SCM_WEAK_TABLE_KIND_BOTH))
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &entry->key,
(GC_PTR) SCM2PTR (k));
- if (SCM_UNPACK (v) && SCM_NIMP (v)
+ if (SCM_UNPACK (v) && SCM_HEAP_OBJECT_P (v)
&& (kind == SCM_WEAK_TABLE_KIND_VALUE
|| kind == SCM_WEAK_TABLE_KIND_BOTH))
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &entry->value,
SCM_SET_CELL_WORD_0 (wv, (len << 8) | scm_tc7_wvect);
- if (SCM_NIMP (fill))
+ if (SCM_HEAP_OBJECT_P (fill))
{
memset (SCM_I_VECTOR_WELTS (wv), 0, len * sizeof (SCM));
for (j = 0; j < len; j++)
elts = SCM_I_VECTOR_WELTS (wv);
- if (prev && SCM_NIMP (PTR2SCM (prev)))
+ if (prev && SCM_HEAP_OBJECT_P (SCM_PACK_POINTER (prev)))
GC_unregister_disappearing_link ((GC_PTR) &elts[k]);
elts[k] = x;
- if (SCM_NIMP (x))
+ if (SCM_HEAP_OBJECT_P (x))
SCM_I_REGISTER_DISAPPEARING_LINK ((GC_PTR) &elts[k],
(GC_PTR) SCM2PTR (x));
}