diff --git a/src/ores.sex b/src/ores.sex index c99253d..6eddacc 100644 --- a/src/ores.sex +++ b/src/ores.sex @@ -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]) diff --git a/src/search.sex b/src/search.sex index 62d594b..ac982c7 100644 --- a/src/search.sex +++ b/src/search.sex @@ -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]) diff --git a/src/tiles.sex b/src/tiles.sex index 5641e77..1fafe3a 100644 --- a/src/tiles.sex +++ b/src/tiles.sex @@ -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