MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

minor nitpicks

+9 -4
+1
include/modules/symbol.h
··· 2 2 #define SYMBOL_H 3 3 4 4 #include <stddef.h> 5 + #include <stdbool.h> 5 6 #include "types.h" 6 7 7 8 void init_symbol_module(void);
+1 -1
src/gc.c
··· 429 429 jsoff_t len = gc_loadoff(ctx->js->mem, old_doff + sizeof(jsoff_t)); 430 430 jsoff_t buf_size = (jsoff_t)(sizeof(jsoff_t) * 2 + sizeof(jsval_t) * cap); 431 431 jsoff_t new_doff = gc_alloc(ctx, buf_size); 432 - if (new_doff == (jsoff_t)~0) goto update_val; 432 + if (new_doff == (jsoff_t)~0) return; 433 433 434 434 memcpy(&ctx->new_mem[new_doff], &ctx->js->mem[old_doff], buf_size); 435 435 for (jsoff_t i = 0; i < len; i++) {
+7 -3
src/modules/server.c
··· 97 97 } write_req_t; 98 98 99 99 static http_server_t *g_server = NULL; 100 + static uv_async_t shutdown_async; 100 101 101 - static void server_signal_handler(int signum) { 102 - uv_stop(uv_default_loop()); exit(0); 103 - } 102 + static void shutdown_async_cb(uv_async_t *handle) { uv_stop(uv_default_loop()); } 103 + static void server_signal_handler(int signum) { uv_async_send(&shutdown_async); } 104 104 105 105 static int parse_accept_encoding(const char *buffer, size_t len) { 106 106 const char *accept_encoding = strstr(buffer, "Accept-Encoding:"); ··· 935 935 936 936 uv_loop_t *loop = uv_default_loop(); 937 937 server->loop = loop; 938 + 939 + uv_async_init(loop, 940 + &shutdown_async, shutdown_async_cb 941 + ); 938 942 939 943 signal(SIGINT, server_signal_handler); 940 944 signal(SIGTERM, server_signal_handler);