static void
py_mimalloc_print_stats(FILE *out)
{
- fprintf(out, "Small block threshold = %zd, in %u size classes.\n",
- MI_SMALL_OBJ_SIZE_MAX, MI_BIN_HUGE);
- fprintf(out, "Medium block threshold = %zd\n",
- MI_MEDIUM_OBJ_SIZE_MAX);
- fprintf(out, "Large object max size = %zd\n",
- MI_LARGE_OBJ_SIZE_MAX);
+ fprintf(out, "Small block threshold = %zu, in %u size classes.\n",
+ (size_t)MI_SMALL_OBJ_SIZE_MAX, MI_BIN_HUGE);
+ fprintf(out, "Medium block threshold = %zu\n",
+ (size_t)MI_MEDIUM_OBJ_SIZE_MAX);
+ fprintf(out, "Large object max size = %zu\n",
+ (size_t)MI_LARGE_OBJ_SIZE_MAX);
mi_heap_t *heap = mi_heap_get_default();
struct _alloc_stats stats;
}
// Returns number of free entry slots in buffer
+#ifndef NDEBUG
static inline unsigned int
gc_mark_buffer_avail(gc_mark_args_t *args)
{
return BUFFER_SIZE - gc_mark_buffer_len(args);
}
+#endif
static inline bool
gc_mark_buffer_is_empty(gc_mark_args_t *args)
return true;
}
- _PyObject_ASSERT_WITH_MSG(op, gc_get_refs(op) >= 0,
- "refcount is too small");
-
if (gc_is_alive(op) || !gc_is_unreachable(op)) {
// Object was already marked as reachable.
return true;
}
+ _PyObject_ASSERT_WITH_MSG(op, gc_get_refs(op) >= 0,
+ "refcount is too small");
+
// GH-129236: If we've seen an active frame without a valid stack pointer,
// then we can't collect objects with deferred references because we may
// have missed some reference to the object on the stack. In that case,
static void
gc_prime_from_spans(gc_mark_args_t *args)
{
- Py_ssize_t space = BUFFER_HI - gc_mark_buffer_len(args);
+ unsigned int space = BUFFER_HI - gc_mark_buffer_len(args);
// there should always be at least this amount of space
assert(space <= gc_mark_buffer_avail(args));
- assert(space > 0);
+ assert(space <= BUFFER_HI);
gc_span_t entry = args->spans.stack[--args->spans.size];
// spans on the stack should always have one or more elements
assert(entry.start < entry.end);