+
+int
+ao_scheme_print_mark_addr(void *addr)
+{
+ int offset;
+
+#if DBG_MEM
+ if (ao_scheme_collecting)
+ ao_scheme_abort();
+#endif
+
+ if (!AO_SCHEME_IS_POOL(addr))
+ return 1;
+
+ if (!ao_scheme_print_cleared) {
+ ao_scheme_print_cleared = 1;
+ memset(ao_scheme_busy, '\0', sizeof (ao_scheme_busy));
+ }
+ offset = pool_offset(addr);
+ if (busy(ao_scheme_busy, offset))
+ return 1;
+ mark(ao_scheme_busy, offset);
+ return 0;
+}
+
+int
+ao_scheme_print_mark_poly(ao_poly p)
+{
+ uint8_t type = ao_scheme_poly_base_type(p);
+
+ if (type == AO_SCHEME_INT)
+ return 1;
+ return ao_scheme_print_mark_addr(ao_scheme_ref(p));
+}
+
+/* Notes that printing has started */
+void
+ao_scheme_print_start(void)
+{
+ ao_scheme_printing++;
+}
+
+/* Notes that printing has ended */
+void
+ao_scheme_print_stop(void)
+{
+ ao_scheme_printing--;
+ if (ao_scheme_printing == 0)
+ ao_scheme_print_cleared = 0;
+}