From 81c19d096300d5c32e56b71357cf8d9432dcc22e Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Mon, 15 Apr 2024 18:46:15 +0300 Subject: [PATCH] Add declarations in new-arena. --- src/code/arena.lisp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/code/arena.lisp b/src/code/arena.lisp index 7a8d294f0..1b9445322 100644 --- a/src/code/arena.lisp +++ b/src/code/arena.lisp @@ -69,19 +69,22 @@ ;;; an arena, obtained via malloc(). Allocations within a block are ;;; contiguous but the blocks can be discontiguous. (defun new-arena (size &optional (growth-amount size) (max-extensions 7)) - (declare (ignorable growth-amount max-extensions)) + (declare (ignorable growth-amount max-extensions) + (fixnum size growth-amount max-extensions)) (assert (>= size 65536)) "Create a new arena of SIZE bytes which can be grown additively by GROWTH-AMOUNT one or more times, not to exceed MAX-EXTENSIONS times" #-system-tlabs :placeholder #+system-tlabs - (let ((layout (find-layout 'arena)) + (let ((layout (load-time-value (find-layout 'arena) t)) (index (with-system-mutex (*arena-lock*) (incf *arena-index-generator*))) - (arena (%make-lisp-obj - (alien-funcall (extern-alien "sbcl_new_arena" (function unsigned unsigned)) - size)))) + (arena (truly-the instance + (%make-lisp-obj + (alien-funcall (extern-alien "sbcl_new_arena" (function unsigned unsigned)) + size))))) (%set-instance-layout arena layout) - (setf (arena-size-limit arena) (+ size (* max-extensions growth-amount)) + (setf (arena-size-limit (truly-the arena arena)) + (+ size (the fixnum (* max-extensions growth-amount))) (arena-growth-amount arena) growth-amount (arena-index arena) index (arena-hidden arena) nil -- 2.11.4.GIT