@kungfu-tech/libnode-win32-x64 0.0.0-bootstrap.0 → 22.22.3-kf.1

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.
Files changed (343) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/dist/node/include/acorn_version.h +6 -0
  4. package/dist/node/include/aliased_buffer-inl.h +244 -0
  5. package/dist/node/include/aliased_buffer.h +206 -0
  6. package/dist/node/include/aliased_struct-inl.h +54 -0
  7. package/dist/node/include/aliased_struct.h +63 -0
  8. package/dist/node/include/amaro_version.h +6 -0
  9. package/dist/node/include/async_context_frame.h +33 -0
  10. package/dist/node/include/async_wrap-inl.h +96 -0
  11. package/dist/node/include/async_wrap.h +243 -0
  12. package/dist/node/include/base_object-inl.h +335 -0
  13. package/dist/node/include/base_object.h +342 -0
  14. package/dist/node/include/base_object_types.h +74 -0
  15. package/dist/node/include/blob_serializer_deserializer-inl.h +385 -0
  16. package/dist/node/include/blob_serializer_deserializer.h +132 -0
  17. package/dist/node/include/callback_queue-inl.h +97 -0
  18. package/dist/node/include/callback_queue.h +79 -0
  19. package/dist/node/include/cares_wrap.h +447 -0
  20. package/dist/node/include/cjs_module_lexer_version.h +6 -0
  21. package/dist/node/include/cleanup_queue-inl.h +36 -0
  22. package/dist/node/include/cleanup_queue.h +79 -0
  23. package/dist/node/include/compile_cache.h +104 -0
  24. package/dist/node/include/connect_wrap.h +26 -0
  25. package/dist/node/include/connection_wrap.h +30 -0
  26. package/dist/node/include/cppgc/allocation.h +310 -0
  27. package/dist/node/include/cppgc/common.h +28 -0
  28. package/dist/node/include/cppgc/cross-thread-persistent.h +466 -0
  29. package/dist/node/include/cppgc/custom-space.h +97 -0
  30. package/dist/node/include/cppgc/default-platform.h +67 -0
  31. package/dist/node/include/cppgc/ephemeron-pair.h +30 -0
  32. package/dist/node/include/cppgc/explicit-management.h +100 -0
  33. package/dist/node/include/cppgc/garbage-collected.h +106 -0
  34. package/dist/node/include/cppgc/heap-consistency.h +309 -0
  35. package/dist/node/include/cppgc/heap-handle.h +48 -0
  36. package/dist/node/include/cppgc/heap-state.h +82 -0
  37. package/dist/node/include/cppgc/heap-statistics.h +120 -0
  38. package/dist/node/include/cppgc/heap.h +202 -0
  39. package/dist/node/include/cppgc/internal/api-constants.h +87 -0
  40. package/dist/node/include/cppgc/internal/atomic-entry-flag.h +48 -0
  41. package/dist/node/include/cppgc/internal/base-page-handle.h +45 -0
  42. package/dist/node/include/cppgc/internal/caged-heap-local-data.h +121 -0
  43. package/dist/node/include/cppgc/internal/caged-heap.h +68 -0
  44. package/dist/node/include/cppgc/internal/compiler-specific.h +38 -0
  45. package/dist/node/include/cppgc/internal/finalizer-trait.h +93 -0
  46. package/dist/node/include/cppgc/internal/gc-info.h +148 -0
  47. package/dist/node/include/cppgc/internal/logging.h +50 -0
  48. package/dist/node/include/cppgc/internal/member-storage.h +256 -0
  49. package/dist/node/include/cppgc/internal/name-trait.h +137 -0
  50. package/dist/node/include/cppgc/internal/persistent-node.h +214 -0
  51. package/dist/node/include/cppgc/internal/pointer-policies.h +243 -0
  52. package/dist/node/include/cppgc/internal/write-barrier.h +487 -0
  53. package/dist/node/include/cppgc/liveness-broker.h +78 -0
  54. package/dist/node/include/cppgc/macros.h +35 -0
  55. package/dist/node/include/cppgc/member.h +629 -0
  56. package/dist/node/include/cppgc/name-provider.h +65 -0
  57. package/dist/node/include/cppgc/object-size-trait.h +58 -0
  58. package/dist/node/include/cppgc/persistent.h +377 -0
  59. package/dist/node/include/cppgc/platform.h +163 -0
  60. package/dist/node/include/cppgc/prefinalizer.h +75 -0
  61. package/dist/node/include/cppgc/process-heap-statistics.h +36 -0
  62. package/dist/node/include/cppgc/sentinel-pointer.h +39 -0
  63. package/dist/node/include/cppgc/source-location.h +16 -0
  64. package/dist/node/include/cppgc/testing.h +106 -0
  65. package/dist/node/include/cppgc/trace-trait.h +128 -0
  66. package/dist/node/include/cppgc/type-traits.h +271 -0
  67. package/dist/node/include/cppgc/visitor.h +504 -0
  68. package/dist/node/include/crypto/crypto_aes.h +88 -0
  69. package/dist/node/include/crypto/crypto_bio.h +193 -0
  70. package/dist/node/include/crypto/crypto_cipher.h +293 -0
  71. package/dist/node/include/crypto/crypto_clienthello-inl.h +90 -0
  72. package/dist/node/include/crypto/crypto_clienthello.h +131 -0
  73. package/dist/node/include/crypto/crypto_common.h +64 -0
  74. package/dist/node/include/crypto/crypto_context.h +171 -0
  75. package/dist/node/include/crypto/crypto_dh.h +126 -0
  76. package/dist/node/include/crypto/crypto_dsa.h +52 -0
  77. package/dist/node/include/crypto/crypto_ec.h +164 -0
  78. package/dist/node/include/crypto/crypto_hash.h +91 -0
  79. package/dist/node/include/crypto/crypto_hkdf.h +61 -0
  80. package/dist/node/include/crypto/crypto_hmac.h +92 -0
  81. package/dist/node/include/crypto/crypto_keygen.h +299 -0
  82. package/dist/node/include/crypto/crypto_keys.h +392 -0
  83. package/dist/node/include/crypto/crypto_pbkdf2.h +74 -0
  84. package/dist/node/include/crypto/crypto_random.h +124 -0
  85. package/dist/node/include/crypto/crypto_rsa.h +136 -0
  86. package/dist/node/include/crypto/crypto_scrypt.h +85 -0
  87. package/dist/node/include/crypto/crypto_sig.h +165 -0
  88. package/dist/node/include/crypto/crypto_spkac.h +21 -0
  89. package/dist/node/include/crypto/crypto_timing.h +20 -0
  90. package/dist/node/include/crypto/crypto_tls.h +305 -0
  91. package/dist/node/include/crypto/crypto_util.h +725 -0
  92. package/dist/node/include/crypto/crypto_x509.h +140 -0
  93. package/dist/node/include/dataqueue/queue.h +306 -0
  94. package/dist/node/include/debug_utils-inl.h +278 -0
  95. package/dist/node/include/debug_utils.h +196 -0
  96. package/dist/node/include/diagnosticfilename-inl.h +33 -0
  97. package/dist/node/include/embedded_data.h +17 -0
  98. package/dist/node/include/encoding_binding.h +61 -0
  99. package/dist/node/include/env-inl.h +984 -0
  100. package/dist/node/include/env.h +1287 -0
  101. package/dist/node/include/env_properties.h +540 -0
  102. package/dist/node/include/handle_wrap.h +123 -0
  103. package/dist/node/include/histogram-inl.h +107 -0
  104. package/dist/node/include/histogram.h +279 -0
  105. package/dist/node/include/inspector/io_agent.h +30 -0
  106. package/dist/node/include/inspector/main_thread_interface.h +116 -0
  107. package/dist/node/include/inspector/network_agent.h +94 -0
  108. package/dist/node/include/inspector/network_inspector.h +45 -0
  109. package/dist/node/include/inspector/network_requests_buffer.h +195 -0
  110. package/dist/node/include/inspector/network_resource_manager.h +29 -0
  111. package/dist/node/include/inspector/node_json.h +24 -0
  112. package/dist/node/include/inspector/node_string.h +101 -0
  113. package/dist/node/include/inspector/protocol_helper.h +27 -0
  114. package/dist/node/include/inspector/runtime_agent.h +41 -0
  115. package/dist/node/include/inspector/target_agent.h +75 -0
  116. package/dist/node/include/inspector/tracing_agent.h +43 -0
  117. package/dist/node/include/inspector/worker_agent.h +40 -0
  118. package/dist/node/include/inspector/worker_inspector.h +124 -0
  119. package/dist/node/include/inspector_agent.h +165 -0
  120. package/dist/node/include/inspector_io.h +78 -0
  121. package/dist/node/include/inspector_profiler.h +149 -0
  122. package/dist/node/include/inspector_socket.h +60 -0
  123. package/dist/node/include/inspector_socket_server.h +110 -0
  124. package/dist/node/include/js_native_api.h +607 -0
  125. package/dist/node/include/js_native_api_types.h +226 -0
  126. package/dist/node/include/js_native_api_v8.h +485 -0
  127. package/dist/node/include/js_native_api_v8_internals.h +45 -0
  128. package/dist/node/include/js_stream.h +52 -0
  129. package/dist/node/include/json_utils.h +172 -0
  130. package/dist/node/include/large_pages/node_large_page.h +34 -0
  131. package/dist/node/include/libplatform/libplatform-export.h +29 -0
  132. package/dist/node/include/libplatform/libplatform.h +112 -0
  133. package/dist/node/include/libplatform/v8-tracing.h +333 -0
  134. package/dist/node/include/memory_tracker-inl.h +359 -0
  135. package/dist/node/include/memory_tracker.h +289 -0
  136. package/dist/node/include/module_wrap.h +216 -0
  137. package/dist/node/include/node.h +1593 -0
  138. package/dist/node/include/node_api.h +265 -0
  139. package/dist/node/include/node_api_internals.h +48 -0
  140. package/dist/node/include/node_api_types.h +56 -0
  141. package/dist/node/include/node_binding.h +161 -0
  142. package/dist/node/include/node_blob.h +159 -0
  143. package/dist/node/include/node_bob-inl.h +36 -0
  144. package/dist/node/include/node_bob.h +107 -0
  145. package/dist/node/include/node_buffer.h +92 -0
  146. package/dist/node/include/node_builtins.h +220 -0
  147. package/dist/node/include/node_config_file.h +46 -0
  148. package/dist/node/include/node_constants.h +82 -0
  149. package/dist/node/include/node_context_data.h +168 -0
  150. package/dist/node/include/node_contextify.h +204 -0
  151. package/dist/node/include/node_crypto.h +56 -0
  152. package/dist/node/include/node_debug.h +30 -0
  153. package/dist/node/include/node_dir.h +52 -0
  154. package/dist/node/include/node_dotenv.h +45 -0
  155. package/dist/node/include/node_errors.h +380 -0
  156. package/dist/node/include/node_exit_code.h +54 -0
  157. package/dist/node/include/node_external_reference.h +165 -0
  158. package/dist/node/include/node_file-inl.h +406 -0
  159. package/dist/node/include/node_file.h +537 -0
  160. package/dist/node/include/node_http2.h +1177 -0
  161. package/dist/node/include/node_http2_state.h +159 -0
  162. package/dist/node/include/node_http_common-inl.h +202 -0
  163. package/dist/node/include/node_http_common.h +535 -0
  164. package/dist/node/include/node_i18n.h +132 -0
  165. package/dist/node/include/node_internals.h +483 -0
  166. package/dist/node/include/node_main_instance.h +67 -0
  167. package/dist/node/include/node_mem-inl.h +113 -0
  168. package/dist/node/include/node_mem.h +45 -0
  169. package/dist/node/include/node_messaging.h +389 -0
  170. package/dist/node/include/node_metadata.h +164 -0
  171. package/dist/node/include/node_modules.h +91 -0
  172. package/dist/node/include/node_mutex.h +323 -0
  173. package/dist/node/include/node_object_wrap.h +132 -0
  174. package/dist/node/include/node_options-inl.h +490 -0
  175. package/dist/node/include/node_options.h +615 -0
  176. package/dist/node/include/node_perf.h +166 -0
  177. package/dist/node/include/node_perf_common.h +102 -0
  178. package/dist/node/include/node_platform.h +238 -0
  179. package/dist/node/include/node_process-inl.h +26 -0
  180. package/dist/node/include/node_process.h +112 -0
  181. package/dist/node/include/node_realm-inl.h +151 -0
  182. package/dist/node/include/node_realm.h +183 -0
  183. package/dist/node/include/node_report.h +43 -0
  184. package/dist/node/include/node_revert.h +82 -0
  185. package/dist/node/include/node_root_certs.h +3520 -0
  186. package/dist/node/include/node_sea.h +74 -0
  187. package/dist/node/include/node_shadow_realm.h +46 -0
  188. package/dist/node/include/node_snapshot_builder.h +57 -0
  189. package/dist/node/include/node_snapshotable.h +174 -0
  190. package/dist/node/include/node_sockaddr-inl.h +257 -0
  191. package/dist/node/include/node_sockaddr.h +394 -0
  192. package/dist/node/include/node_sqlite.h +270 -0
  193. package/dist/node/include/node_stat_watcher.h +73 -0
  194. package/dist/node/include/node_task_runner.h +92 -0
  195. package/dist/node/include/node_threadsafe_cow-inl.h +54 -0
  196. package/dist/node/include/node_threadsafe_cow.h +105 -0
  197. package/dist/node/include/node_union_bytes.h +81 -0
  198. package/dist/node/include/node_url.h +96 -0
  199. package/dist/node/include/node_v8.h +77 -0
  200. package/dist/node/include/node_v8_platform-inl.h +185 -0
  201. package/dist/node/include/node_version.h +110 -0
  202. package/dist/node/include/node_wasi.h +184 -0
  203. package/dist/node/include/node_wasm_web_api.h +55 -0
  204. package/dist/node/include/node_watchdog.h +154 -0
  205. package/dist/node/include/node_webstorage.h +60 -0
  206. package/dist/node/include/node_worker.h +158 -0
  207. package/dist/node/include/path.h +33 -0
  208. package/dist/node/include/permission/addon_permission.h +31 -0
  209. package/dist/node/include/permission/child_process_permission.h +31 -0
  210. package/dist/node/include/permission/fs_permission.h +167 -0
  211. package/dist/node/include/permission/inspector_permission.h +31 -0
  212. package/dist/node/include/permission/permission.h +138 -0
  213. package/dist/node/include/permission/permission_base.h +65 -0
  214. package/dist/node/include/permission/wasi_permission.h +31 -0
  215. package/dist/node/include/permission/worker_permission.h +31 -0
  216. package/dist/node/include/pipe_wrap.h +80 -0
  217. package/dist/node/include/quic/application.h +159 -0
  218. package/dist/node/include/quic/bindingdata.h +272 -0
  219. package/dist/node/include/quic/cid.h +127 -0
  220. package/dist/node/include/quic/data.h +148 -0
  221. package/dist/node/include/quic/defs.h +245 -0
  222. package/dist/node/include/quic/endpoint.h +458 -0
  223. package/dist/node/include/quic/http3.h +15 -0
  224. package/dist/node/include/quic/logstream.h +81 -0
  225. package/dist/node/include/quic/packet.h +152 -0
  226. package/dist/node/include/quic/preferredaddress.h +72 -0
  227. package/dist/node/include/quic/session.h +443 -0
  228. package/dist/node/include/quic/sessionticket.h +108 -0
  229. package/dist/node/include/quic/streams.h +232 -0
  230. package/dist/node/include/quic/tlscontext.h +227 -0
  231. package/dist/node/include/quic/tokens.h +256 -0
  232. package/dist/node/include/quic/transportparams.h +165 -0
  233. package/dist/node/include/req_wrap-inl.h +171 -0
  234. package/dist/node/include/req_wrap.h +77 -0
  235. package/dist/node/include/spawn_sync.h +243 -0
  236. package/dist/node/include/stream_base-inl.h +173 -0
  237. package/dist/node/include/stream_base.h +478 -0
  238. package/dist/node/include/stream_pipe.h +76 -0
  239. package/dist/node/include/stream_wrap.h +132 -0
  240. package/dist/node/include/string_bytes.h +113 -0
  241. package/dist/node/include/string_decoder-inl.h +31 -0
  242. package/dist/node/include/string_decoder.h +49 -0
  243. package/dist/node/include/tcp_wrap.h +105 -0
  244. package/dist/node/include/threadpoolwork-inl.h +70 -0
  245. package/dist/node/include/timer_wrap-inl.h +32 -0
  246. package/dist/node/include/timer_wrap.h +85 -0
  247. package/dist/node/include/timers.h +70 -0
  248. package/dist/node/include/tracing/agent.h +195 -0
  249. package/dist/node/include/tracing/node_trace_buffer.h +83 -0
  250. package/dist/node/include/tracing/node_trace_writer.h +75 -0
  251. package/dist/node/include/tracing/trace_event.h +722 -0
  252. package/dist/node/include/tracing/trace_event_common.h +1109 -0
  253. package/dist/node/include/tracing/traced_value.h +129 -0
  254. package/dist/node/include/tty_wrap.h +65 -0
  255. package/dist/node/include/udp_wrap.h +230 -0
  256. package/dist/node/include/undici_version.h +6 -0
  257. package/dist/node/include/util-inl.h +700 -0
  258. package/dist/node/include/util.h +1021 -0
  259. package/dist/node/include/uv/aix.h +32 -0
  260. package/dist/node/include/uv/bsd.h +34 -0
  261. package/dist/node/include/uv/darwin.h +61 -0
  262. package/dist/node/include/uv/errno.h +483 -0
  263. package/dist/node/include/uv/linux.h +34 -0
  264. package/dist/node/include/uv/os390.h +33 -0
  265. package/dist/node/include/uv/posix.h +31 -0
  266. package/dist/node/include/uv/sunos.h +44 -0
  267. package/dist/node/include/uv/threadpool.h +37 -0
  268. package/dist/node/include/uv/tree.h +521 -0
  269. package/dist/node/include/uv/unix.h +512 -0
  270. package/dist/node/include/uv/version.h +43 -0
  271. package/dist/node/include/uv/win.h +698 -0
  272. package/dist/node/include/uv.h +1990 -0
  273. package/dist/node/include/v8-array-buffer.h +525 -0
  274. package/dist/node/include/v8-callbacks.h +462 -0
  275. package/dist/node/include/v8-container.h +183 -0
  276. package/dist/node/include/v8-context.h +485 -0
  277. package/dist/node/include/v8-cppgc.h +245 -0
  278. package/dist/node/include/v8-data.h +80 -0
  279. package/dist/node/include/v8-date.h +48 -0
  280. package/dist/node/include/v8-debug.h +168 -0
  281. package/dist/node/include/v8-embedder-heap.h +82 -0
  282. package/dist/node/include/v8-embedder-state-scope.h +52 -0
  283. package/dist/node/include/v8-exception.h +223 -0
  284. package/dist/node/include/v8-extension.h +62 -0
  285. package/dist/node/include/v8-external.h +37 -0
  286. package/dist/node/include/v8-fast-api-calls.h +984 -0
  287. package/dist/node/include/v8-forward.h +82 -0
  288. package/dist/node/include/v8-function-callback.h +607 -0
  289. package/dist/node/include/v8-function.h +140 -0
  290. package/dist/node/include/v8-handle-base.h +137 -0
  291. package/dist/node/include/v8-initialization.h +289 -0
  292. package/dist/node/include/v8-inspector-protocol.h +13 -0
  293. package/dist/node/include/v8-inspector.h +419 -0
  294. package/dist/node/include/v8-internal.h +1397 -0
  295. package/dist/node/include/v8-isolate.h +1767 -0
  296. package/dist/node/include/v8-json.h +47 -0
  297. package/dist/node/include/v8-local-handle.h +758 -0
  298. package/dist/node/include/v8-locker.h +138 -0
  299. package/dist/node/include/v8-maybe.h +160 -0
  300. package/dist/node/include/v8-memory-span.h +198 -0
  301. package/dist/node/include/v8-message.h +233 -0
  302. package/dist/node/include/v8-metrics.h +264 -0
  303. package/dist/node/include/v8-microtask-queue.h +157 -0
  304. package/dist/node/include/v8-microtask.h +28 -0
  305. package/dist/node/include/v8-object.h +824 -0
  306. package/dist/node/include/v8-persistent-handle.h +582 -0
  307. package/dist/node/include/v8-platform.h +1358 -0
  308. package/dist/node/include/v8-primitive-object.h +118 -0
  309. package/dist/node/include/v8-primitive.h +877 -0
  310. package/dist/node/include/v8-profiler.h +1302 -0
  311. package/dist/node/include/v8-promise.h +174 -0
  312. package/dist/node/include/v8-proxy.h +50 -0
  313. package/dist/node/include/v8-regexp.h +106 -0
  314. package/dist/node/include/v8-script.h +904 -0
  315. package/dist/node/include/v8-snapshot.h +266 -0
  316. package/dist/node/include/v8-source-location.h +92 -0
  317. package/dist/node/include/v8-statistics.h +238 -0
  318. package/dist/node/include/v8-template.h +1297 -0
  319. package/dist/node/include/v8-traced-handle.h +432 -0
  320. package/dist/node/include/v8-typed-array.h +390 -0
  321. package/dist/node/include/v8-unwinder-state.h +31 -0
  322. package/dist/node/include/v8-unwinder.h +132 -0
  323. package/dist/node/include/v8-util.h +665 -0
  324. package/dist/node/include/v8-value-serializer-version.h +24 -0
  325. package/dist/node/include/v8-value-serializer.h +316 -0
  326. package/dist/node/include/v8-value.h +655 -0
  327. package/dist/node/include/v8-version-string.h +38 -0
  328. package/dist/node/include/v8-version.h +20 -0
  329. package/dist/node/include/v8-wasm-trap-handler-posix.h +31 -0
  330. package/dist/node/include/v8-wasm-trap-handler-win.h +28 -0
  331. package/dist/node/include/v8-wasm.h +201 -0
  332. package/dist/node/include/v8-weak-callback-info.h +80 -0
  333. package/dist/node/include/v8.h +88 -0
  334. package/dist/node/include/v8config.h +981 -0
  335. package/dist/node/include/zlib_version.h +6 -0
  336. package/dist/node/libnode.dll +0 -0
  337. package/dist/node/libnode.lib +0 -0
  338. package/dist/node/libnodebuildinfo.json +10 -0
  339. package/dist/node/link_node.lib +0 -0
  340. package/dist/node/link_node.node +0 -0
  341. package/index.js +5 -0
  342. package/libnode.release.json +8 -0
  343. package/package.json +29 -1
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @kungfu-tech/libnode-win32-x64
2
+
3
+ This package contains libnode binaries for win32-x64.
@@ -0,0 +1,6 @@
1
+ // This is an auto generated file, please do not edit.
2
+ // Refer to tools/dep_updaters/update-acorn.sh
3
+ #ifndef SRC_ACORN_VERSION_H_
4
+ #define SRC_ACORN_VERSION_H_
5
+ #define ACORN_VERSION "8.16.0"
6
+ #endif // SRC_ACORN_VERSION_H_
@@ -0,0 +1,244 @@
1
+ #ifndef SRC_ALIASED_BUFFER_INL_H_
2
+ #define SRC_ALIASED_BUFFER_INL_H_
3
+
4
+ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
+
6
+ #include "aliased_buffer.h"
7
+ #include "memory_tracker-inl.h"
8
+ #include "util-inl.h"
9
+
10
+ namespace node {
11
+
12
+ typedef size_t AliasedBufferIndex;
13
+
14
+ template <typename NativeT, typename V8T>
15
+ AliasedBufferBase<NativeT, V8T>::AliasedBufferBase(
16
+ v8::Isolate* isolate, const size_t count, const AliasedBufferIndex* index)
17
+ : isolate_(isolate), count_(count), byte_offset_(0), index_(index) {
18
+ CHECK_GT(count, 0);
19
+ if (index != nullptr) {
20
+ // Will be deserialized later.
21
+ return;
22
+ }
23
+ const v8::HandleScope handle_scope(isolate_);
24
+ const size_t size_in_bytes =
25
+ MultiplyWithOverflowCheck(sizeof(NativeT), count);
26
+
27
+ // allocate v8 ArrayBuffer
28
+ v8::Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(isolate_, size_in_bytes);
29
+ buffer_ = static_cast<NativeT*>(ab->Data());
30
+
31
+ // allocate v8 TypedArray
32
+ v8::Local<V8T> js_array = V8T::New(ab, byte_offset_, count);
33
+ js_array_ = v8::Global<V8T>(isolate, js_array);
34
+ }
35
+
36
+ template <typename NativeT, typename V8T>
37
+ AliasedBufferBase<NativeT, V8T>::AliasedBufferBase(
38
+ v8::Isolate* isolate,
39
+ const size_t byte_offset,
40
+ const size_t count,
41
+ const AliasedBufferBase<uint8_t, v8::Uint8Array>& backing_buffer,
42
+ const AliasedBufferIndex* index)
43
+ : isolate_(isolate),
44
+ count_(count),
45
+ byte_offset_(byte_offset),
46
+ index_(index) {
47
+ if (index != nullptr) {
48
+ // Will be deserialized later.
49
+ return;
50
+ }
51
+ const v8::HandleScope handle_scope(isolate_);
52
+ v8::Local<v8::ArrayBuffer> ab = backing_buffer.GetArrayBuffer();
53
+
54
+ // validate that the byte_offset is aligned with sizeof(NativeT)
55
+ CHECK_EQ(byte_offset & (sizeof(NativeT) - 1), 0);
56
+ // validate this fits inside the backing buffer
57
+ CHECK_LE(MultiplyWithOverflowCheck(sizeof(NativeT), count),
58
+ ab->ByteLength() - byte_offset);
59
+
60
+ buffer_ = reinterpret_cast<NativeT*>(
61
+ const_cast<uint8_t*>(backing_buffer.GetNativeBuffer() + byte_offset));
62
+
63
+ v8::Local<V8T> js_array = V8T::New(ab, byte_offset, count);
64
+ js_array_ = v8::Global<V8T>(isolate, js_array);
65
+ }
66
+
67
+ template <typename NativeT, typename V8T>
68
+ AliasedBufferBase<NativeT, V8T>::AliasedBufferBase(
69
+ const AliasedBufferBase& that)
70
+ : isolate_(that.isolate_),
71
+ count_(that.count_),
72
+ byte_offset_(that.byte_offset_),
73
+ buffer_(that.buffer_) {
74
+ js_array_ = v8::Global<V8T>(that.isolate_, that.GetJSArray());
75
+ DCHECK(is_valid());
76
+ }
77
+
78
+ template <typename NativeT, typename V8T>
79
+ AliasedBufferIndex AliasedBufferBase<NativeT, V8T>::Serialize(
80
+ v8::Local<v8::Context> context, v8::SnapshotCreator* creator) {
81
+ DCHECK(is_valid());
82
+ return creator->AddData(context, GetJSArray());
83
+ }
84
+
85
+ template <typename NativeT, typename V8T>
86
+ inline void AliasedBufferBase<NativeT, V8T>::Deserialize(
87
+ v8::Local<v8::Context> context) {
88
+ DCHECK_NOT_NULL(index_);
89
+ v8::Local<V8T> arr =
90
+ context->GetDataFromSnapshotOnce<V8T>(*index_).ToLocalChecked();
91
+ // These may not hold true for AliasedBuffers that have grown, so should
92
+ // be removed when we expand the snapshot support.
93
+ DCHECK_EQ(count_, arr->Length());
94
+ DCHECK_EQ(byte_offset_, arr->ByteOffset());
95
+ uint8_t* raw = static_cast<uint8_t*>(arr->Buffer()->Data());
96
+ buffer_ = reinterpret_cast<NativeT*>(raw + byte_offset_);
97
+ js_array_.Reset(isolate_, arr);
98
+ index_ = nullptr;
99
+ }
100
+
101
+ template <typename NativeT, typename V8T>
102
+ AliasedBufferBase<NativeT, V8T>& AliasedBufferBase<NativeT, V8T>::operator=(
103
+ AliasedBufferBase<NativeT, V8T>&& that) noexcept {
104
+ DCHECK(is_valid());
105
+ this->~AliasedBufferBase();
106
+ isolate_ = that.isolate_;
107
+ count_ = that.count_;
108
+ byte_offset_ = that.byte_offset_;
109
+ buffer_ = that.buffer_;
110
+
111
+ js_array_.Reset(isolate_, that.js_array_.Get(isolate_));
112
+
113
+ that.buffer_ = nullptr;
114
+ that.js_array_.Reset();
115
+ return *this;
116
+ }
117
+
118
+ template <typename NativeT, typename V8T>
119
+ v8::Local<V8T> AliasedBufferBase<NativeT, V8T>::GetJSArray() const {
120
+ DCHECK(is_valid());
121
+ return js_array_.Get(isolate_);
122
+ }
123
+
124
+ template <typename NativeT, typename V8T>
125
+ void AliasedBufferBase<NativeT, V8T>::Release() {
126
+ DCHECK_NULL(index_);
127
+ js_array_.Reset();
128
+ }
129
+
130
+ template <typename NativeT, typename V8T>
131
+ inline void AliasedBufferBase<NativeT, V8T>::MakeWeak() {
132
+ DCHECK(is_valid());
133
+ js_array_.SetWeak();
134
+ }
135
+
136
+ template <typename NativeT, typename V8T>
137
+ v8::Local<v8::ArrayBuffer> AliasedBufferBase<NativeT, V8T>::GetArrayBuffer()
138
+ const {
139
+ return GetJSArray()->Buffer();
140
+ }
141
+
142
+ template <typename NativeT, typename V8T>
143
+ inline const NativeT* AliasedBufferBase<NativeT, V8T>::GetNativeBuffer() const {
144
+ DCHECK(is_valid());
145
+ return buffer_;
146
+ }
147
+
148
+ template <typename NativeT, typename V8T>
149
+ inline const NativeT* AliasedBufferBase<NativeT, V8T>::operator*() const {
150
+ return GetNativeBuffer();
151
+ }
152
+
153
+ template <typename NativeT, typename V8T>
154
+ inline void AliasedBufferBase<NativeT, V8T>::SetValue(const size_t index,
155
+ NativeT value) {
156
+ DCHECK_LT(index, count_);
157
+ DCHECK(is_valid());
158
+ buffer_[index] = value;
159
+ }
160
+
161
+ template <typename NativeT, typename V8T>
162
+ inline const NativeT AliasedBufferBase<NativeT, V8T>::GetValue(
163
+ const size_t index) const {
164
+ DCHECK(is_valid());
165
+ DCHECK_LT(index, count_);
166
+ return buffer_[index];
167
+ }
168
+
169
+ template <typename NativeT, typename V8T>
170
+ typename AliasedBufferBase<NativeT, V8T>::Reference
171
+ AliasedBufferBase<NativeT, V8T>::operator[](size_t index) {
172
+ DCHECK(is_valid());
173
+ return Reference(this, index);
174
+ }
175
+
176
+ template <typename NativeT, typename V8T>
177
+ NativeT AliasedBufferBase<NativeT, V8T>::operator[](size_t index) const {
178
+ return GetValue(index);
179
+ }
180
+
181
+ template <typename NativeT, typename V8T>
182
+ size_t AliasedBufferBase<NativeT, V8T>::Length() const {
183
+ return count_;
184
+ }
185
+
186
+ template <typename NativeT, typename V8T>
187
+ void AliasedBufferBase<NativeT, V8T>::reserve(size_t new_capacity) {
188
+ DCHECK(is_valid());
189
+ DCHECK_GE(new_capacity, count_);
190
+ DCHECK_EQ(byte_offset_, 0);
191
+ const v8::HandleScope handle_scope(isolate_);
192
+
193
+ const size_t old_size_in_bytes = sizeof(NativeT) * count_;
194
+ const size_t new_size_in_bytes =
195
+ MultiplyWithOverflowCheck(sizeof(NativeT), new_capacity);
196
+
197
+ // allocate v8 new ArrayBuffer
198
+ v8::Local<v8::ArrayBuffer> ab =
199
+ v8::ArrayBuffer::New(isolate_, new_size_in_bytes);
200
+
201
+ // allocate new native buffer
202
+ NativeT* new_buffer = static_cast<NativeT*>(ab->Data());
203
+ // copy old content
204
+ memcpy(new_buffer, buffer_, old_size_in_bytes);
205
+
206
+ // allocate v8 TypedArray
207
+ v8::Local<V8T> js_array = V8T::New(ab, byte_offset_, new_capacity);
208
+
209
+ // move over old v8 TypedArray
210
+ js_array_ = std::move(v8::Global<V8T>(isolate_, js_array));
211
+
212
+ buffer_ = new_buffer;
213
+ count_ = new_capacity;
214
+ }
215
+
216
+ template <typename NativeT, typename V8T>
217
+ inline bool AliasedBufferBase<NativeT, V8T>::is_valid() const {
218
+ return index_ == nullptr && !js_array_.IsEmpty();
219
+ }
220
+
221
+ template <typename NativeT, typename V8T>
222
+ inline size_t AliasedBufferBase<NativeT, V8T>::SelfSize() const {
223
+ return sizeof(*this);
224
+ }
225
+
226
+ #define VM(NativeT, V8T) \
227
+ template <> \
228
+ inline const char* AliasedBufferBase<NativeT, v8::V8T>::MemoryInfoName() \
229
+ const { \
230
+ return "Aliased" #V8T; \
231
+ } \
232
+ template <> \
233
+ inline void AliasedBufferBase<NativeT, v8::V8T>::MemoryInfo( \
234
+ node::MemoryTracker* tracker) const { \
235
+ tracker->TrackField("js_array", js_array_); \
236
+ }
237
+ ALIASED_BUFFER_LIST(VM)
238
+ #undef VM
239
+
240
+ } // namespace node
241
+
242
+ #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
243
+
244
+ #endif // SRC_ALIASED_BUFFER_INL_H_
@@ -0,0 +1,206 @@
1
+ #ifndef SRC_ALIASED_BUFFER_H_
2
+ #define SRC_ALIASED_BUFFER_H_
3
+
4
+ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
+
6
+ #include <cinttypes>
7
+ #include "memory_tracker.h"
8
+ #include "v8.h"
9
+
10
+ namespace node {
11
+
12
+ typedef size_t AliasedBufferIndex;
13
+
14
+ /**
15
+ * Do not use this class directly when creating instances of it - use the
16
+ * Aliased*Array defined at the end of this file instead.
17
+ *
18
+ * This class encapsulates the technique of having a native buffer mapped to
19
+ * a JS object. Writes to the native buffer can happen efficiently without
20
+ * going through JS, and the data is then available to user's via the exposed
21
+ * JS object.
22
+ *
23
+ * While this technique is computationally efficient, it is effectively a
24
+ * write to JS program state w/out going through the standard
25
+ * (monitored) API. Thus, any VM capabilities to detect the modification are
26
+ * circumvented.
27
+ *
28
+ * The encapsulation herein provides a placeholder where such writes can be
29
+ * observed. Any notification APIs will be left as a future exercise.
30
+ */
31
+ template <class NativeT, class V8T>
32
+ class AliasedBufferBase final : public MemoryRetainer {
33
+ public:
34
+ static_assert(std::is_scalar_v<NativeT>);
35
+
36
+ AliasedBufferBase(v8::Isolate* isolate,
37
+ size_t count,
38
+ const AliasedBufferIndex* index = nullptr);
39
+
40
+ /**
41
+ * Create an AliasedBufferBase over a sub-region of another aliased buffer.
42
+ * The two will share a v8::ArrayBuffer instance &
43
+ * a native buffer, but will each read/write to different sections of the
44
+ * native buffer.
45
+ *
46
+ * Note that byte_offset must be aligned by sizeof(NativeT).
47
+ */
48
+ // TODO(refack): refactor into a non-owning `AliasedBufferBaseView`
49
+ AliasedBufferBase(
50
+ v8::Isolate* isolate,
51
+ size_t byte_offset,
52
+ size_t count,
53
+ const AliasedBufferBase<uint8_t, v8::Uint8Array>& backing_buffer,
54
+ const AliasedBufferIndex* index = nullptr);
55
+
56
+ AliasedBufferBase(const AliasedBufferBase& that);
57
+
58
+ AliasedBufferIndex Serialize(v8::Local<v8::Context> context,
59
+ v8::SnapshotCreator* creator);
60
+
61
+ void Deserialize(v8::Local<v8::Context> context);
62
+
63
+ AliasedBufferBase& operator=(AliasedBufferBase&& that) noexcept;
64
+
65
+ /**
66
+ * Helper class that is returned from operator[] to support assignment into
67
+ * a specified location.
68
+ */
69
+ class Reference {
70
+ public:
71
+ Reference(AliasedBufferBase* aliased_buffer, const size_t index)
72
+ : aliased_buffer_(aliased_buffer), index_(index) {}
73
+
74
+ Reference(const Reference& that)
75
+ : aliased_buffer_(that.aliased_buffer_),
76
+ index_(that.index_) {
77
+ }
78
+
79
+ Reference& operator=(const NativeT& val) {
80
+ aliased_buffer_->SetValue(index_, val);
81
+ return *this;
82
+ }
83
+
84
+ Reference& operator=(const Reference& val) {
85
+ return *this = static_cast<NativeT>(val);
86
+ }
87
+
88
+ operator NativeT() const {
89
+ return aliased_buffer_->GetValue(index_);
90
+ }
91
+
92
+ Reference& operator+=(const NativeT& val) {
93
+ const NativeT current = aliased_buffer_->GetValue(index_);
94
+ aliased_buffer_->SetValue(index_, current + val);
95
+ return *this;
96
+ }
97
+
98
+ Reference& operator+=(const Reference& val) {
99
+ return this->operator+=(static_cast<NativeT>(val));
100
+ }
101
+
102
+ Reference& operator-=(const NativeT& val) {
103
+ const NativeT current = aliased_buffer_->GetValue(index_);
104
+ aliased_buffer_->SetValue(index_, current - val);
105
+ return *this;
106
+ }
107
+
108
+ private:
109
+ AliasedBufferBase* aliased_buffer_;
110
+ size_t index_;
111
+ };
112
+
113
+ /**
114
+ * Get the underlying v8 TypedArray overlaid on top of the native buffer
115
+ */
116
+ v8::Local<V8T> GetJSArray() const;
117
+
118
+ void Release();
119
+
120
+ /**
121
+ * Make the global reference to the typed array weak. The caller must make
122
+ * sure that no operation can be done on the AliasedBuffer when the typed
123
+ * array becomes unreachable. Usually this means the caller must maintain
124
+ * a JS reference to the typed array from JS object.
125
+ */
126
+ void MakeWeak();
127
+
128
+ /**
129
+ * Get the underlying v8::ArrayBuffer underlying the TypedArray and
130
+ * overlaying the native buffer
131
+ */
132
+ v8::Local<v8::ArrayBuffer> GetArrayBuffer() const;
133
+
134
+ /**
135
+ * Get the underlying native buffer. Note that all reads/writes should occur
136
+ * through the GetValue/SetValue/operator[] methods
137
+ */
138
+ const NativeT* GetNativeBuffer() const;
139
+
140
+ /**
141
+ * Synonym for GetBuffer()
142
+ */
143
+ const NativeT* operator*() const;
144
+
145
+ /**
146
+ * Set position index to given value.
147
+ */
148
+ void SetValue(size_t index, NativeT value);
149
+
150
+ /**
151
+ * Get value at position index
152
+ */
153
+ const NativeT GetValue(size_t index) const;
154
+
155
+ /**
156
+ * Effectively, a synonym for GetValue/SetValue
157
+ */
158
+ Reference operator[](size_t index);
159
+
160
+ NativeT operator[](size_t index) const;
161
+
162
+ size_t Length() const;
163
+
164
+ // Should only be used to extend the array.
165
+ // Should only be used on an owning array, not one created as a sub array of
166
+ // an owning `AliasedBufferBase`.
167
+ void reserve(size_t new_capacity);
168
+
169
+ size_t SelfSize() const override;
170
+
171
+ const char* MemoryInfoName() const override;
172
+ void MemoryInfo(MemoryTracker* tracker) const override;
173
+
174
+ private:
175
+ bool is_valid() const;
176
+ v8::Isolate* isolate_ = nullptr;
177
+ size_t count_ = 0;
178
+ size_t byte_offset_ = 0;
179
+ NativeT* buffer_ = nullptr;
180
+ v8::Global<V8T> js_array_;
181
+
182
+ // Deserialize data
183
+ const AliasedBufferIndex* index_ = nullptr;
184
+ };
185
+
186
+ #define ALIASED_BUFFER_LIST(V) \
187
+ V(int8_t, Int8Array) \
188
+ V(uint8_t, Uint8Array) \
189
+ V(int16_t, Int16Array) \
190
+ V(uint16_t, Uint16Array) \
191
+ V(int32_t, Int32Array) \
192
+ V(uint32_t, Uint32Array) \
193
+ V(float, Float32Array) \
194
+ V(double, Float64Array) \
195
+ V(int64_t, BigInt64Array)
196
+
197
+ #define V(NativeT, V8T) \
198
+ typedef AliasedBufferBase<NativeT, v8::V8T> Aliased##V8T;
199
+ ALIASED_BUFFER_LIST(V)
200
+ #undef V
201
+
202
+ } // namespace node
203
+
204
+ #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
205
+
206
+ #endif // SRC_ALIASED_BUFFER_H_