Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

DoubleArray変換時省メモリかほぼ終了: 残るはコード整理のみ

  • Loading branch information...
commit e93568b2db5a9c71b4fd80aac918efec66dc26c9 1 parent 8935978
@sile authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 double-array_node-allocator.lisp
View
10 double-array_node-allocator.lisp
@@ -4,7 +4,7 @@
allocate))
(in-package :dawg.double-array.node-allocator)
-(defconstant +MANAGE_RANGE+ 89120)
+(defconstant +MANAGE_RANGE+ 8912)
(deftype base-flag () `(simple-bit-vector ,+MANAGE_RANGE+))
(deftype nexts () `(simple-array fixnum (,+MANAGE_RANGE+)))
@@ -93,13 +93,17 @@
;;(print `(:alloc ,index ,arcs))
(with-slots (bits head prevs nexts offset) (the node-allocator alloca)
(when (<= offset index)
+ (assert (<= offset index))
(setf (bit bits (- index offset)) 1))
(loop WITH base = index
FOR arc OF-TYPE (mod #x100) IN arcs
FOR index OF-TYPE fixnum = (+ base arc)
DO
+ (ref alloca index) ;; XXX:
(macrolet ((prev (index) `(aref prevs (- ,index offset)))
(next (index) `(aref nexts (- ,index offset))))
+ (assert (/= (prev index) -1))
+ (assert (/= (next index) -1))
;;(print (list index (prev index) (next index)))
;; XXX:
(when (= head index)
@@ -108,9 +112,11 @@
(when (<= offset (prev index))
(setf (next (prev index)) (next index)))
- (when (<= offset index)
+
(ref alloca index)
(ref alloca (next index))
+ (when (<= offset index)
+
(setf (prev (next index)) (prev index)
(prev index) -1
Please sign in to comment.
Something went wrong with that request. Please try again.