Enable local multi-declarations. Fix of builtin argument checking. Migrate to @noinit.

This commit is contained in:
Christoffer Lerno
2023-02-11 02:03:02 +01:00
parent 18de9a146b
commit 1548cd06ef
30 changed files with 259 additions and 106 deletions

View File

@@ -57,7 +57,7 @@ const LINELEN = 60;
fn void repeat_fasta(String seq, int n)
{
usz len = seq.len;
int i = void;
int i @noinit;
for (i = 0; i < n; i++)
{
io::putchar(seq[i % len]);
@@ -70,12 +70,12 @@ fn void random_fasta(String symb, double[] probability, int n)
{
assert(symb.len == probability.len);
int len = probability.len;
int i = void;
int i @noinit;
for (i = 0; i < n; i++)
{
double v = fasta_rand(1.0);
/* slowest idiomatic linear lookup. Fast if len is short though. */
int j = void;
int j @noinit;
for (j = 0; j < len - 1; j++)
{
v -= probability[j];

View File

@@ -137,7 +137,7 @@ fn MemInfo* newnolink(Value th, int enc, Auint sz)
fn void growaux_(Value th, void *block, AuintIdx *size, AuintIdx size_elems, AuintIdx limit)
{
void* newblock;
AuintIdx newsize = void;
AuintIdx newsize @noinit;
// cannot double it?
if (*size >= limit / 2)
{