File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -432,6 +432,9 @@ void ResetSignalHandlers() {
432
432
}
433
433
434
434
static std::atomic<uint32_t > init_process_flags = 0 ;
435
+ static_assert (
436
+ std::is_same_v<std::underlying_type_t <ProcessInitializationFlags::Flags>,
437
+ uint32_t >);
435
438
436
439
static void PlatformInit (ProcessInitializationFlags::Flags flags) {
437
440
// init_process_flags is accessed in ResetStdio(),
@@ -1057,7 +1060,7 @@ std::unique_ptr<InitializationResult> InitializeOncePerProcess(
1057
1060
}
1058
1061
1059
1062
void TearDownOncePerProcess () {
1060
- const uint64_t flags = init_process_flags.load ();
1063
+ const uint32_t flags = init_process_flags.load ();
1061
1064
ResetStdio ();
1062
1065
if (!(flags & ProcessInitializationFlags::kNoDefaultSignalHandling )) {
1063
1066
ResetSignalHandlers ();
Original file line number Diff line number Diff line change @@ -227,10 +227,8 @@ class Environment;
227
227
class MultiIsolatePlatform ;
228
228
class InitializationResultImpl ;
229
229
230
- namespace ProcessFlags {
231
- // TODO(addaleax): Switch to uint32_t to match std::atomic<uint32_t>
232
- // init_process_flags in node.cc
233
- enum Flags : uint64_t {
230
+ namespace ProcessInitializationFlags {
231
+ enum Flags : uint32_t {
234
232
kNoFlags = 0 ,
235
233
// Enable stdio inheritance, which is disabled by default.
236
234
// This flag is also implied by kNoStdioInitialization.
@@ -270,9 +268,8 @@ enum Flags : uint64_t {
270
268
kNoParseGlobalDebugVariables | kNoAdjustResourceLimits |
271
269
kNoUseLargePages | kNoPrintHelpOrVersionOutput ,
272
270
};
273
- } // namespace ProcessFlags
274
- // TODO(addaleax): Make this the canonical name, as it is more descriptive.
275
- namespace ProcessInitializationFlags = ProcessFlags;
271
+ } // namespace ProcessInitializationFlags
272
+ namespace ProcessFlags = ProcessInitializationFlags; // Legacy alias.
276
273
277
274
class NODE_EXTERN InitializationResult {
278
275
public:
You can’t perform that action at this time.
0 commit comments