Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/guides/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ This tells you the join needed about 1 GB of temporary memory beyond what was al
| Tool | What It Does | When to Use |
|---|---|---|
| `(.sys.mem 0)` | Returns heap allocation statistics | Monitor memory usage, detect leaks |
| `(.sys.gc 0)` | Flushes caches, releases pages | Between heavy queries, before benchmarks |
| `(.sys.gc)` | Flushes caches, releases pages | Between heavy queries, before benchmarks |
| `(.sys.info 0)` | Shows system and runtime info | Check total RAM, CPU count, OS details |
| `(timeit expr)` | Measures execution time of one expression | Benchmark a specific operation |
| `:timeit` | Toggles profiling for all REPL expressions | Interactive performance exploration |
Expand Down
3 changes: 2 additions & 1 deletion src/ops/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,8 @@ ray_t* ray_mem_ts_fn(ray_t** args, int64_t n) {
* pages/pools. Rayforce values are reference-counted, so this is allocator
* GC rather than a tracing collector. Variadic to allow `(.sys.gc)`. */
ray_t* ray_gc_fn(ray_t** args, int64_t n) {
(void)args; (void)n;
(void)args;
if (n != 0) return ray_error("domain", ".sys.gc takes no arguments");
ray_heap_gc();
/* Same statement-boundary rule as the REPL: an explicit maintenance
* call is also a chance to notice the process has gone quiet. */
Expand Down
8 changes: 4 additions & 4 deletions test/rfl/system/reserved_namespace.rfl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
;; `'?` regardless of arity — so we exercise by calling, which is
;; what actually matters here.)
;; .sys.gc returns 0 on success — doubles as a binding-exists probe.
;; Registered as variadic so both (.sys.gc) and (.sys.gc 0) work;
;; other .sys.* info builtins follow the same convention.
;; Registered as variadic so the zero-argument call remains valid while
;; the implementation can reject unexpected arguments explicitly.
(.sys.gc) -- 0
(.sys.gc 0) -- 0
(.sys.gc 0) !- domain
(count (.sys.info)) -- 5
(count (.sys.mem)) -- 16
(count (.sys.build)) -- 2
Expand Down Expand Up @@ -116,7 +116,7 @@ internals !- name
(del .sys.gc) !- reserve
(del .os.getenv) !- reserve
;; Built-in still resolves after the blocked shadow attempts.
(.sys.gc 0) -- 0
(.sys.gc) -- 0
(nil? .os.getenv) -- false
;; User-level dotted writes under a non-`.` root still work.
(set myns.x 1)
Expand Down
4 changes: 2 additions & 2 deletions test/rfl/system/system_branch_cov.rfl
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
;; ray_gc_fn (line 539)
;; ══════════════════════════════════════════════════════════════════════
(.sys.gc) -- 0
(.sys.gc 0) -- 0
(.sys.gc "x") -- 0
(.sys.gc 0) !- domain
(.sys.gc "x") !- domain

;; ────────────── teardown ──────────────
(.sys.exec "rm -rf /tmp/rfl_sys_bc_*")
Loading