Mint APE Loader v1.5

This change ports APE Loader to Linux AARCH64, so that Raspberry Pi
users can run programs like redbean, without the executable needing
to modify itself. Progress has also slipped into this change on the
issue of making progress better conforming to user expectations and
industry standards regarding which symbols we're allowed to declare
This commit is contained in:
Justine Tunney 2023-07-26 13:54:49 -07:00
parent 6843150e0c
commit 7e0a09feec
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
510 changed files with 1783 additions and 1483 deletions

View file

@ -64,12 +64,12 @@ static wontreturn void __arena_die(void) {
}
forceinline void __arena_check(void) {
_unassert(__arena.depth);
unassert(__arena.depth);
}
forceinline void __arena_check_pointer(void *p) {
_unassert(BASE + __arena.offset[__arena.depth - 1] <= (uintptr_t)p &&
(uintptr_t)p < BASE + __arena.offset[__arena.depth]);
unassert(BASE + __arena.offset[__arena.depth - 1] <= (uintptr_t)p &&
(uintptr_t)p < BASE + __arena.offset[__arena.depth]);
}
forceinline bool __arena_is_arena_pointer(void *p) {
@ -322,7 +322,7 @@ void __arena_push(void) {
if (!__arena.depth) {
__arena_install();
} else {
_unassert(__arena.depth < ARRAYLEN(__arena.offset) - 1);
unassert(__arena.depth < ARRAYLEN(__arena.offset) - 1);
}
__arena.offset[__arena.depth + 1] = __arena.offset[__arena.depth];
++__arena.depth;

View file

@ -93,8 +93,8 @@ static void DeferFunction(struct StackFrame *frame, void *fn, void *arg) {
void __defer(void *rbp, void *fn, void *arg) {
struct StackFrame *f, *frame = rbp;
f = __builtin_frame_address(0);
_unassert(f->next == frame);
_unassert(PointerNotOwnedByParentStackFrame(f, frame, arg));
unassert(f->next == frame);
unassert(PointerNotOwnedByParentStackFrame(f, frame, arg));
DeferFunction(frame, fn, arg);
}

View file

@ -51,8 +51,8 @@ int LeftmostInt(const struct SortedInts *t, int k) {
r = m;
}
}
_unassert(l == 0 || k >= t->p[l - 1]);
_unassert(l == t->n || k <= t->p[l]);
unassert(l == 0 || k >= t->p[l - 1]);
unassert(l == t->n || k <= t->p[l]);
return l;
}
@ -70,8 +70,8 @@ int CountInt(const struct SortedInts *t, int k) {
bool InsertInt(struct SortedInts *t, int k, bool u) {
int l;
_unassert(t->n >= 0);
_unassert(t->n <= t->c);
unassert(t->n >= 0);
unassert(t->n <= t->c);
if (t->n == t->c) {
++t->c;
if (!IsModeDbg()) {