Get Cosmopolitan into releasable state

A new rollup tool now exists for flattening out the headers in a way
that works better for our purposes than cpp. A lot of the API clutter
has been removed. APIs that aren't a sure thing in terms of general
recommendation are now marked internal.

There's now a smoke test for the amalgamation archive and gigantic
header file. So we can now guarantee you can use this project on the
easiest difficulty setting without the gigantic repository.

A website is being created, which is currently a work in progress:
https://justine.storage.googleapis.com/cosmopolitan/index.html
This commit is contained in:
Justine Tunney 2020-11-25 08:19:00 -08:00
parent dba7552c1e
commit ea0b5d9d1c
775 changed files with 6864 additions and 3963 deletions

View file

@ -28,7 +28,7 @@
TEST(grow, testNull_hasAllocatingBehavior) {
void *p = NULL;
size_t capacity = 0;
EXPECT_TRUE(grow(&p, &capacity, 1, 0));
EXPECT_TRUE(__grow(&p, &capacity, 1, 0));
EXPECT_NE(NULL, p);
EXPECT_EQ(32, capacity);
free_s(&p);
@ -37,7 +37,7 @@ TEST(grow, testNull_hasAllocatingBehavior) {
TEST(grow, testCapacity_isInUnits_withTerminatorGuarantee) {
void *p = NULL;
size_t capacity = 0;
EXPECT_TRUE(grow(&p, &capacity, 8, 0));
EXPECT_TRUE(__grow(&p, &capacity, 8, 0));
EXPECT_NE(NULL, p);
EXPECT_EQ(32 / 8 + 1, capacity);
free_s(&p);
@ -48,7 +48,7 @@ TEST(grow, testStackMemory_convertsToDynamic) {
int *p = A;
size_t capacity = ARRAYLEN(A);
if (!isheap(p)) {
EXPECT_TRUE(grow(&p, &capacity, sizeof(int), 0));
EXPECT_TRUE(__grow(&p, &capacity, sizeof(int), 0));
EXPECT_TRUE(isheap(p));
EXPECT_GT(capacity, ARRAYLEN(A));
EXPECT_EQ(1, p[0]);
@ -64,7 +64,7 @@ TEST(grow, testGrowth_clearsNewMemory) {
size_t i, capacity = 123;
char *p = malloc(capacity);
memset(p, 'a', capacity);
EXPECT_TRUE(grow(&p, &capacity, 1, 0));
EXPECT_TRUE(__grow(&p, &capacity, 1, 0));
EXPECT_GT(capacity, 123);
for (i = 0; i < 123; ++i) ASSERT_EQ('a', p[i]);
for (i = 123; i < capacity; ++i) ASSERT_EQ(0, p[i]);
@ -74,11 +74,11 @@ TEST(grow, testGrowth_clearsNewMemory) {
TEST(grow, testBonusParam_willGoAboveAndBeyond) {
size_t capacity = 32;
char *p = malloc(capacity);
EXPECT_TRUE(grow(&p, &capacity, 1, 0));
EXPECT_TRUE(__grow(&p, &capacity, 1, 0));
EXPECT_LT(capacity, 1024);
free_s(&p);
p = malloc((capacity = 32));
EXPECT_TRUE(grow(&p, &capacity, 1, 1024));
EXPECT_TRUE(__grow(&p, &capacity, 1, 1024));
EXPECT_GT(capacity, 1024);
free_s(&p);
}
@ -88,7 +88,7 @@ TEST(grow, testOverflow_returnsFalseAndDoesNotFree) {
int *p = A;
size_t capacity = ARRAYLEN(A);
if (!isheap(p)) {
EXPECT_FALSE(grow(&p, &capacity, pushpop(SIZE_MAX), 0));
EXPECT_FALSE(__grow(&p, &capacity, pushpop(SIZE_MAX), 0));
EXPECT_FALSE(isheap(p));
EXPECT_EQ(capacity, ARRAYLEN(A));
EXPECT_EQ(1, p[0]);