Add LinkedList Operators and Update Tests (#2438)

* Add LinkedList Operators and Update Tests
* add linkedlist printing and `@new` macros (single-line init and pool-capable)
* add linkedlist node and reg iterator; comparisons w/ ==
* Fix benchmarks. Drop random access to the linked list using []. Only return a direct array view.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Zack Puhl
2025-09-06 05:57:21 -04:00
committed by GitHub
parent 79c0c8e082
commit 078d9dc0b7
9 changed files with 407 additions and 186 deletions

View File

@@ -56,6 +56,7 @@ long cycle_stop @local;
DString benchmark_log @local;
bool benchmark_warming @local;
uint this_iteration @local;
bool benchmark_stop @local;
macro @start_benchmark()
{
@@ -69,6 +70,12 @@ macro @end_benchmark()
cycle_stop = $$sysclock();
}
macro @kill_benchmark(String format, ...)
{
@log_benchmark(format, $vasplat);
benchmark_stop = true;
}
macro @log_benchmark(msg, args...) => @pool()
{
if (benchmark_warming) return;
@@ -133,6 +140,7 @@ fn bool run_benchmarks(BenchmarkUnit[] benchmarks)
@start_benchmark(); // can be overridden by calls inside the unit's func
unit.func() @inline;
if (benchmark_stop) return false;
if (benchmark_nano_seconds == (NanoDuration){}) @end_benchmark(); // only mark when it wasn't already by the unit.func