mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
* Added SCM_DEBUG_CELL_ACCESSES debug option.
This commit is contained in:
parent
1a548472dd
commit
46d53380a2
3 changed files with 37 additions and 4 deletions
|
@ -1,3 +1,16 @@
|
|||
2000-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* __scm.h (SCM_DEBUG_CELL_ACCESSES), gc.h (SCM_): Added as a new
|
||||
debug option to verify all accesses to cells actually access
|
||||
objects on the heap.
|
||||
|
||||
* gc.h (SCM_VALIDATE_CELL): Added. Only performs validation if
|
||||
SCM_DEBUG_CELL_ACCESSES is set to 1.
|
||||
|
||||
(SCM_CELL_WORD, SCM_CELL_OBJECT, SCM_SET_CELL_WORD,
|
||||
SCM_SET_CELL_OBJECT): Use SCM_VALIDATE_CELL to check every cell
|
||||
that is accessed.
|
||||
|
||||
2000-05-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* gh_data.c (gh_scm2chars, gh_scm2shorts, gh_scm2longs,
|
||||
|
|
|
@ -160,6 +160,15 @@
|
|||
#define SCM_DEBUG 0
|
||||
#endif
|
||||
|
||||
/* If SCM_DEBUG_CELL_ACCESSES is set to 1, cell accesses will perform
|
||||
* exhaustive parameter checking: It will be verified that cell parameters
|
||||
* actually point to a valid heap cell. Note: If this option is enabled,
|
||||
* guile will run about ten times slower than normally.
|
||||
*/
|
||||
#ifndef SCM_DEBUG_CELL_ACCESSES
|
||||
#define SCM_DEBUG_CELL_ACCESSES SCM_DEBUG
|
||||
#endif
|
||||
|
||||
/* If SCM_DEBUG_DEPRECATED is set to 1, deprecated code is not compiled. This
|
||||
* can be used by developers to get rid of references to deprecated code.
|
||||
*/
|
||||
|
|
|
@ -85,25 +85,36 @@ typedef scm_cell * SCM_CELLPTR;
|
|||
/* Low level cell data accessing macros:
|
||||
*/
|
||||
|
||||
#define SCM_CELL_WORD(x, n) (((scm_bits_t *) SCM2PTR (x)) [n])
|
||||
#define SCM_VALIDATE_CELL(x) \
|
||||
(SCM_DEBUG_CELL_ACCESSES ? (!scm_cellp (x) ? abort () : 1) : 1)
|
||||
|
||||
#define SCM_CELL_WORD(x, n) \
|
||||
((SCM_VALIDATE_CELL (x)), \
|
||||
(((scm_bits_t *) SCM2PTR (x)) [n]))
|
||||
#define SCM_CELL_WORD_0(x) SCM_CELL_WORD (x, 0)
|
||||
#define SCM_CELL_WORD_1(x) SCM_CELL_WORD (x, 1)
|
||||
#define SCM_CELL_WORD_2(x) SCM_CELL_WORD (x, 2)
|
||||
#define SCM_CELL_WORD_3(x) SCM_CELL_WORD (x, 3)
|
||||
|
||||
#define SCM_CELL_OBJECT(x, n) (SCM_PACK (((scm_bits_t *) SCM2PTR (x)) [n]))
|
||||
#define SCM_CELL_OBJECT(x, n) \
|
||||
((SCM_VALIDATE_CELL (x)), \
|
||||
(SCM_PACK (((scm_bits_t *) SCM2PTR (x)) [n])))
|
||||
#define SCM_CELL_OBJECT_0(x) SCM_CELL_OBJECT (x, 0)
|
||||
#define SCM_CELL_OBJECT_1(x) SCM_CELL_OBJECT (x, 1)
|
||||
#define SCM_CELL_OBJECT_2(x) SCM_CELL_OBJECT (x, 2)
|
||||
#define SCM_CELL_OBJECT_3(x) SCM_CELL_OBJECT (x, 3)
|
||||
|
||||
#define SCM_SET_CELL_WORD(x, n, v) ((((scm_bits_t *) SCM2PTR (x)) [n]) = (scm_bits_t) (v))
|
||||
#define SCM_SET_CELL_WORD(x, n, v) \
|
||||
((SCM_VALIDATE_CELL (x)), \
|
||||
((((scm_bits_t *) SCM2PTR (x)) [n]) = (scm_bits_t) (v)))
|
||||
#define SCM_SET_CELL_WORD_0(x, v) SCM_SET_CELL_WORD (x, 0, v)
|
||||
#define SCM_SET_CELL_WORD_1(x, v) SCM_SET_CELL_WORD (x, 1, v)
|
||||
#define SCM_SET_CELL_WORD_2(x, v) SCM_SET_CELL_WORD (x, 2, v)
|
||||
#define SCM_SET_CELL_WORD_3(x, v) SCM_SET_CELL_WORD (x, 3, v)
|
||||
|
||||
#define SCM_SET_CELL_OBJECT(x, n, v) ((((scm_bits_t *) SCM2PTR (x)) [n]) = SCM_UNPACK (v))
|
||||
#define SCM_SET_CELL_OBJECT(x, n, v) \
|
||||
((SCM_VALIDATE_CELL (x)), \
|
||||
((((scm_bits_t *) SCM2PTR (x)) [n]) = SCM_UNPACK (v)))
|
||||
#define SCM_SET_CELL_OBJECT_0(x, v) SCM_SET_CELL_OBJECT (x, 0, v)
|
||||
#define SCM_SET_CELL_OBJECT_1(x, v) SCM_SET_CELL_OBJECT (x, 1, v)
|
||||
#define SCM_SET_CELL_OBJECT_2(x, v) SCM_SET_CELL_OBJECT (x, 2, v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue