size the thread and file arrays by their constants
An array of a header type takes a symbolic size now (sex#60). The records holding them are pub, so their constants are too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -323,9 +323,7 @@
|
||||
(var n int 0)
|
||||
(list-files root "" paths (& n))
|
||||
(qsort paths n (sizeof [paths 0]) by-name)
|
||||
;; TODO sex#60: size with MAX-DEPOSIT-FILES once arrays of a header
|
||||
;; type take a symbolic size.
|
||||
(var files [* cJSON 64])
|
||||
(var files [* cJSON MAX-DEPOSIT-FILES])
|
||||
(for (var f int 0) (< f n) (++ f)
|
||||
(var path [char 1024])
|
||||
(snprintf path (sizeof path) "%s/%s" root [paths f])
|
||||
|
||||
@@ -31,12 +31,10 @@
|
||||
;;; mask the least reading category.
|
||||
(pub define SEARCH-MINERAL 4)
|
||||
(define SEARCH-STEP 16)
|
||||
(define MAX-SEARCH-THREADS 16)
|
||||
(pub define MAX-SEARCH-THREADS 16)
|
||||
|
||||
;; TODO sex#60: size threads with MAX-SEARCH-THREADS once arrays of a
|
||||
;; header type take a symbolic size.
|
||||
(pub record search
|
||||
((lock pthread-mutex-t) (threads [pthread-t 16]) (thread-count int) (running bool)
|
||||
((lock pthread-mutex-t) (threads [pthread-t MAX-SEARCH-THREADS]) (thread-count int) (running bool)
|
||||
(cancel bool)
|
||||
;; the question
|
||||
(settings world-settings) (rivers river-config) (assets-dir [char 1024])
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
;;; River tiles are sampled at a resolution the viewer picks by zoom,
|
||||
;;; in the key's `stratum': a column costs too much to sample them all
|
||||
;;; for an overview.
|
||||
(define MAX-WORKERS 32)
|
||||
(pub define MAX-WORKERS 32)
|
||||
|
||||
(define TILE-FREE 0)
|
||||
(define TILE-QUEUED 1)
|
||||
@@ -76,9 +76,7 @@
|
||||
(queue [int MAX-TILES]) (queue-len int) (queue-pos int)
|
||||
(free-slots [int MAX-TILES]) (free-count int)
|
||||
(settings world-settings) (rivers river-config) (assets-dir [char 1024]) (generation int)
|
||||
;; TODO sex#60: size with MAX-WORKERS once arrays of a header type
|
||||
;; take a symbolic size.
|
||||
(workers [pthread-t 32]) (worker-count int) (quit bool) (frame u64) (waiting int)
|
||||
(workers [pthread-t MAX-WORKERS]) (worker-count int) (quit bool) (frame u64) (waiting int)
|
||||
(palette [u32 256])))
|
||||
|
||||
(fn key-hash ((k tile-key)) u64
|
||||
|
||||
Reference in New Issue
Block a user