]> gitweb.factorcode.org Git - factor.git/commitdiff
Revert "layouts: change max-array-capacity to most-positive-fixnum"
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Feb 2022 20:55:40 +0000 (12:55 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 15 Feb 2022 20:55:40 +0000 (12:55 -0800)
This reverts commit ffad6a8dc8e33cf9811d08a02cd46aa3fcce8ee0.

core/growable/growable.factor
core/layouts/layouts.factor

index e203b1a722ffcf4f808cad5e980c612d92c5156a..e6daa965a4cdae3cc709e0662c8cbd4556d5b019 100644 (file)
@@ -1,9 +1,10 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-IN: growable
-MIXIN: growable ! for bootstrap
-USING: accessors kernel layouts math math.private sequences
+USING: accessors kernel math math.private sequences
 sequences.private ;
+IN: growable
+
+MIXIN: growable
 
 SLOT: length
 SLOT: underlying
@@ -45,9 +46,7 @@ M: growable set-length
     ] if
     length<< ;
 
-: new-size ( old -- new )
-    integer>fixnum-strict 1 fixnum+fast 2 fixnum*fast
-    dup 0 < [ drop most-positive-fixnum ] when ; inline
+: new-size ( old -- new ) 1 + 2 * ; inline
 
 : ensure ( n seq -- n seq )
     bounds-check-head
index ec9a0a90bd86e9279a082232328fd7b4e7cc34fc..c0c9a277ddb2c79c5bd95441ce3d337af14bab37 100644 (file)
@@ -73,7 +73,11 @@ SYMBOL: header-bits
 : most-negative-fixnum ( -- n )
     first-bignum neg >fixnum ; inline
 
-ALIAS: max-array-capacity most-positive-fixnum
+: (max-array-capacity) ( b -- n )
+    2 - 2^ 1 - ; inline
+
+: max-array-capacity ( -- n )
+    fixnum-bits (max-array-capacity) ; inline
 
 : bootstrap-first-bignum ( -- n )
     bootstrap-cell-bits (first-bignum) ;
@@ -84,7 +88,8 @@ ALIAS: max-array-capacity most-positive-fixnum
 : bootstrap-most-negative-fixnum ( -- n )
     bootstrap-first-bignum neg ;
 
-ALIAS: bootstrap-max-array-capacity bootstrap-most-positive-fixnum
+: bootstrap-max-array-capacity ( -- n )
+    bootstrap-fixnum-bits (max-array-capacity) ;
 
 M: bignum >integer
     dup most-negative-fixnum most-positive-fixnum between?