Do more quality assurance work

This commit is contained in:
Justine Tunney 2024-06-24 06:53:49 -07:00
parent 67b19ae733
commit d461c6f47d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
31 changed files with 194 additions and 108 deletions

View file

@ -54,9 +54,6 @@
#include "tool/args/args.h"
__static_yoink("lua_notice");
STATIC_STACK_ALIGN(GetStackSize());
#if !defined(LUA_PROGNAME)
#define LUA_PROGNAME "lua"
#endif

View file

@ -36,6 +36,10 @@
#include "libc/runtime/runtime.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/map.h"
#include "libc/nt/runtime.h"
#include "libc/intrin/directmap.internal.h"
#include "libc/thread/thread.h"
#include "libc/dce.h"
#include "third_party/nsync/wait_s.internal.h"
__static_yoink("nsync_notice");
@ -154,10 +158,19 @@ waiter *nsync_dll_waiter_samecond_ (struct Dll *e) {
static void *nsync_malloc (size_t size) {
void *res;
res = mmap (0, size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS,
-1, 0);
if (!IsWindows ()) {
// too much of a performance hit to track
res = __sys_mmap ((void *)0x7110000000, size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS,
-1, 0, 0);
} else {
// must be tracked for fork() resurrection
res = mmap (0, size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS,
-1, 0);
}
if (res == MAP_FAILED)
nsync_panic_ ("out of memory\n");
return res;
@ -168,7 +181,7 @@ static void *nsync_malloc (size_t size) {
static struct Dll *free_waiters = NULL;
/* free_waiters points to a doubly-linked list of free waiter structs. */
static nsync_atomic_uint32_ free_waiters_mu; /* spinlock; protects free_waiters */
nsync_atomic_uint32_ free_waiters_mu; /* spinlock; protects free_waiters */
#define waiter_for_thread __get_tls()->tib_nsync
@ -236,6 +249,8 @@ void nsync_waiter_free_ (waiter *w) {
nsync_spin_test_and_set_ (&free_waiters_mu, 1, 1, 0);
dll_make_first (&free_waiters, &w->nw.q);
ATM_STORE_REL (&free_waiters_mu, 0); /* release store */
if (w == waiter_for_thread)
waiter_for_thread = 0;
}
}

View file

@ -7,7 +7,6 @@
#include "libc/assert.h"
#include "libc/log/log.h"
#include "libc/mem/mem.h"
#include "libc/runtime/stack.h"
#include "third_party/python/Include/bytesobject.h"
#include "third_party/python/Include/compile.h"
#include "third_party/python/Include/fileutils.h"
@ -18,8 +17,6 @@
#include "third_party/python/Include/pymacro.h"
#include "third_party/python/Include/pythonrun.h"
STATIC_STACK_ALIGN(GetStackSize());
#define HEADER "\
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│\n\
vi: set et ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi \n\

View file

@ -13,7 +13,6 @@
#include "libc/log/log.h"
#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/stack.h"
#include "libc/testlib/testlib.h"
#include "libc/x/x.h"
#include "third_party/python/Include/abstract.h"
@ -39,8 +38,6 @@
#include "third_party/python/Include/warnings.h"
#include "third_party/python/Include/yoink.h"
STATIC_STACK_ALIGN(GetStackSize());
#define USE_COSMO_CRASH MODE_DBG + 0
__static_yoink("zipos");

View file

@ -64,8 +64,6 @@
#include "libc/serialize.h"
#include "tool/build/lib/stripcomponents.h"
STATIC_STACK_ALIGN(GetStackSize());
__static_yoink("_PyUnicode_GetCode");
#define MANUAL "\

View file

@ -4,13 +4,10 @@
Python 3
https://docs.python.org/3/license.html │
*/
#include "libc/runtime/stack.h"
#include "third_party/python/Include/yoink.h"
#include "third_party/python/runpythonmodule.h"
#include "tool/args/args.h"
STATIC_STACK_ALIGN(GetStackSize());
PYTHON_YOINK("xed");
PYTHON_YOINK("xterm");

View file

@ -6,13 +6,10 @@
*/
#include "libc/log/log.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/stack.h"
#include "third_party/python/Include/yoink.h"
#include "third_party/python/runpythonmodule.h"
#include "tool/args/args.h"
STATIC_STACK_ALIGN(GetStackSize());
int
main(int argc, char **argv)
{

View file

@ -4,13 +4,10 @@
Python 3
https://docs.python.org/3/license.html │
*/
#include "libc/runtime/stack.h"
#include "third_party/python/Include/yoink.h"
#include "third_party/python/runpythonmodule.h"
#include "tool/args/args.h"
STATIC_STACK_ALIGN(GetStackSize());
int
main(int argc, char **argv)
{