node/lib/internal/modules/esm/shared_constants.js
Jacob Smith 4667b07cd2
esm: move hook execution to separate thread
PR-URL: https://github.com/nodejs/node/pull/44710
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Michaël Zasso <targos@protonmail.com>
2023-04-13 09:35:17 +02:00

26 lines
633 B
JavaScript

// This file contains the definition for the constant values that must be
// available to both the main thread and the loader thread.
'use strict';
/*
The shared memory area is divided in 1 32-bit long section. It has to be 32-bit long as
`Atomics.notify` only works with `Int32Array` objects.
--32-bits--
^
|
|
WORKER_TO_MAIN_THREAD_NOTIFICATION
WORKER_TO_MAIN_THREAD_NOTIFICATION is only used to send notifications, its value is going to
increase every time the worker sends a notification to the main thread.
*/
module.exports = {
WORKER_TO_MAIN_THREAD_NOTIFICATION: 0,
SHARED_MEMORY_BYTE_LENGTH: 1 * 4,
};