Fix make-array transforms.
[sbcl.git] / src / runtime / cheneygc-internal.h
1 /*
2  * This software is part of the SBCL system. See the README file for
3  * more information.
4  *
5  * This software is derived from the CMU CL system, which was
6  * written at Carnegie Mellon University and released into the
7  * public domain. The software is in the public domain and is
8  * provided with absolutely no warranty. See the COPYING and CREDITS
9  * files for more information.
10  */
11
12 #include "os.h" /* for os_context_t */
13
14 extern lispobj *from_space;
15 extern lispobj *from_space_free_pointer;
16
17 extern lispobj *new_space;
18 extern lispobj *new_space_free_pointer;
19
20
21 /* predicates */
22 /* #if defined(DEBUG_SPACE_PREDICATES) */
23 #if 0
24 boolean
25 from_space_p(lispobj object)
26 {
27     lispobj *ptr;
28
29     /* this can be called for untagged pointers as well as for
30        descriptors, so this assertion's not applicable
31        gc_assert(is_lisp_pointer(object));
32     */
33     ptr = (lispobj *) native_pointer(object);
34
35     return ((from_space <= ptr) &&
36             (ptr < from_space_free_pointer));
37 }
38
39 boolean
40 new_space_p(lispobj object)
41 {
42     lispobj *ptr;
43
44     /*    gc_assert(is_lisp_pointer(object)); */
45
46     ptr = (lispobj *) native_pointer(object);
47
48     return ((new_space <= ptr) &&
49             (ptr < new_space_free_pointer));
50 }
51
52 #else
53
54 #define from_space_p(ptr) \
55         ((from_space <= ((lispobj *) ((pointer_sized_uint_t) ptr))) && \
56          (((lispobj *) ((pointer_sized_uint_t) ptr))< from_space_free_pointer))
57
58 #define new_space_p(ptr) \
59         ((new_space <= ((lispobj *) ((pointer_sized_uint_t) ptr))) && \
60          (((lispobj *) ((pointer_sized_uint_t) ptr)) < new_space_free_pointer))
61
62 #endif
63
64 extern boolean cheneygc_handle_wp_violation(os_context_t*, void*);