mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
Your Actually Portable Executables now contains a simple virtual memory that works similarly to the Linux Kernel in the sense that it maps your physical memory to negative addresses. This is needed to support mmap() and malloc(). This functionality has zero code size impact. For example the MODE=tiny LIFE.COM executable is still only 12KB in size. The APE bootloader code has also been simplified to improve readibility and further elevate the elegance by which we're able to support so many platforms thereby enhancing verifiability so that we may engender trust in this bootloading process.
14 lines
496 B
C
14 lines
496 B
C
#include "libc/fmt/fmt.h"
|
|
#include "libc/runtime/runtime.h"
|
|
#include "libc/stdio/stdio.h"
|
|
#include "libc/str/str.h"
|
|
|
|
STATIC_YOINK("sys_mmap"); /* asan needs it */
|
|
STATIC_YOINK("TrackMemoryInterval"); /* asan needs it */
|
|
|
|
#define ASSERT(x, y) Assert2(x, y, #y, __FILE__, __LINE__)
|
|
#define ASSERT128(x, y) Assert128(x, y, #y, __FILE__, __LINE__)
|
|
|
|
void Assert(long, long, char *);
|
|
void Assert2(long, long, char *, char *, int);
|
|
void Assert128(__int128, __int128, char *, char *, int);
|