Make fixes, improvements, and chibicc python bindings

- python now mixes audio 10x faster
- python octal notation is restored
- chibicc now builds code 3x faster
- chibicc now has help documentation
- chibicc can now generate basic python bindings
- linenoise now supports some paredit-like features

See #141
This commit is contained in:
Justine Tunney 2021-10-08 08:11:51 -07:00
parent 28997f3acb
commit 7061c79c22
121 changed files with 5272 additions and 1928 deletions

View file

@ -30,6 +30,7 @@
#include "libc/sysv/consts/map.h"
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/prot.h"
#include "libc/testlib/ezbench.h"
#include "libc/testlib/testlib.h"
#define N 1024
@ -82,3 +83,25 @@ TEST(malloc, test) {
for (i = 0; i < ARRAYLEN(fds); ++i) close(fds[i]);
malloc_trim(0);
}
void *bulk[1024];
void BulkFreeBenchSetup(void) {
size_t i;
for (i = 0; i < ARRAYLEN(bulk); ++i) {
bulk[i] = malloc(rand() % 64);
}
}
void FreeBulk(void) {
size_t i;
for (i = 0; i < ARRAYLEN(bulk); ++i) {
free(bulk[i]);
}
}
BENCH(bulk_free, bench) {
EZBENCH2("free() bulk", BulkFreeBenchSetup(), FreeBulk());
EZBENCH2("bulk_free()", BulkFreeBenchSetup(),
bulk_free(bulk, ARRAYLEN(bulk)));
}