vsql-node 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +203 -2
- package/binding.gyp +61 -0
- package/index.d.ts +133 -0
- package/internal/amalgamation/LICENSE +21 -0
- package/internal/amalgamation/LICENSE-V +21 -0
- package/internal/amalgamation/afunix.h +26 -0
- package/internal/amalgamation/atomic.h +571 -0
- package/internal/amalgamation/core_windows.c +25 -0
- package/internal/amalgamation/core_windows.h +9 -0
- package/internal/amalgamation/execute_capture_nix.c +7 -0
- package/internal/amalgamation/execute_capture_nix.h +266 -0
- package/internal/amalgamation/gc/cord.h +426 -0
- package/internal/amalgamation/gc/cord_pos.h +151 -0
- package/internal/amalgamation/gc/ec.h +91 -0
- package/internal/amalgamation/gc/gc.h +2826 -0
- package/internal/amalgamation/gc/gc_allocator.h +480 -0
- package/internal/amalgamation/gc/gc_backptr.h +109 -0
- package/internal/amalgamation/gc/gc_config_macros.h +548 -0
- package/internal/amalgamation/gc/gc_disclaim.h +85 -0
- package/internal/amalgamation/gc/gc_gcj.h +123 -0
- package/internal/amalgamation/gc/gc_inline.h +261 -0
- package/internal/amalgamation/gc/gc_mark.h +516 -0
- package/internal/amalgamation/gc/gc_pthread_redirects.h +140 -0
- package/internal/amalgamation/gc/gc_tiny_fl.h +107 -0
- package/internal/amalgamation/gc/gc_typed.h +196 -0
- package/internal/amalgamation/gc/gc_version.h +55 -0
- package/internal/amalgamation/gc/javaxfc.h +76 -0
- package/internal/amalgamation/gc/leak_detector.h +120 -0
- package/internal/amalgamation/gc.c +45932 -0
- package/internal/amalgamation/gc.h +4 -0
- package/internal/amalgamation/gc_boehm_helpers.c +64 -0
- package/internal/amalgamation/gc_debugger_linux.h +61 -0
- package/internal/amalgamation/getrandom_linux.h +33 -0
- package/internal/amalgamation/ipv6_v6only.h +5 -0
- package/internal/amalgamation/libvsql.c +27 -0
- package/internal/amalgamation/libvsql.h +1772 -0
- package/internal/amalgamation/libvsql_linux_amd64.c +106591 -0
- package/internal/amalgamation/libvsql_linux_arm64.c +106571 -0
- package/internal/amalgamation/libvsql_macos_amd64.c +106728 -0
- package/internal/amalgamation/libvsql_macos_arm64.c +106708 -0
- package/internal/amalgamation/libvsql_windows_amd64.c +108235 -0
- package/internal/amalgamation/segfault_handler_nix.c +56 -0
- package/internal/amalgamation/segfault_handler_nix.h +449 -0
- package/internal/amalgamation/segfault_handler_windows.h +52 -0
- package/internal/amalgamation/thread_helper.c +12 -0
- package/internal/amalgamation/thread_helper.h +96 -0
- package/internal/amalgamation/ticks_windows.c +3 -0
- package/internal/amalgamation/ticks_windows.h +31 -0
- package/internal/amalgamation/ticks_windows_api.h +6 -0
- package/internal/amalgamation/vsql_runtime.c +14 -0
- package/internal/amalgamation/vsql_runtime_linux.c +6 -0
- package/internal/amalgamation/vsql_runtime_macos.c +6 -0
- package/internal/amalgamation/vsql_runtime_windows.c +6 -0
- package/lib/binding.js +13 -0
- package/lib/connection.js +492 -0
- package/lib/convert.js +213 -0
- package/lib/errors.js +17 -0
- package/lib/index.js +41 -0
- package/libvsql_flags.gypi +30 -0
- package/package.json +45 -4
- package/prebuilds/darwin-arm64/vsql-node.glibc.node +0 -0
- package/prebuilds/darwin-x64/vsql-node.glibc.node +0 -0
- package/prebuilds/linux-arm64/vsql-node.glibc.node +0 -0
- package/prebuilds/linux-x64/vsql-node.glibc.node +0 -0
- package/prebuilds/win32-x64/vsql-node.glibc.node +0 -0
- package/src/binding.c +773 -0
- package/src/runtime.c +20 -0
package/src/runtime.c
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// runtime.c compiles the garbage collector and V's helpers from the
|
|
2
|
+
// amalgamation, which have to be compiled separately from libvsql.c (see
|
|
3
|
+
// internal/amalgamation/vsql_runtime.c).
|
|
4
|
+
#include "vsql_runtime.c"
|
|
5
|
+
|
|
6
|
+
// vsql_gc_after_node_init is called when the addon is loaded (see binding.c).
|
|
7
|
+
// libvsql initializes the garbage collector from a C constructor, when the
|
|
8
|
+
// addon is loaded, which registers the thread that loaded it with the
|
|
9
|
+
// collector for good. So the collector could stop that thread, or scan its
|
|
10
|
+
// stack, while it's running JavaScript. Every other thread is only registered
|
|
11
|
+
// while it's in a libvsql routine, and after this that thread is too.
|
|
12
|
+
//
|
|
13
|
+
// Unlike Go, Node doesn't replace the signal handlers that the collector uses
|
|
14
|
+
// to stop threads on Linux (SIGPWR and SIGXCPU), unless the program listens
|
|
15
|
+
// for them with process.on.
|
|
16
|
+
void vsql_gc_after_node_init(void) {
|
|
17
|
+
if (GC_thread_is_registered()) {
|
|
18
|
+
GC_unregister_my_thread();
|
|
19
|
+
}
|
|
20
|
+
}
|