summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-03-08 13:56:31 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-03-11 16:23:31 +0100
commite16a2be8d8ec70866d3eed7dddbe7f11b4f20aa7 (patch)
treedfde8772903c49dccad34fa48be05cb8fadd8e27 /src/env.h
parent695590e386845bc11bb42aa7f26327f2fba6d2a5 (diff)
downloadnode-new-e16a2be8d8ec70866d3eed7dddbe7f11b4f20aa7.tar.gz
src: avoid duplicate Before/AtExitCallback structs
Currently, BeforeExitCallback and AtExitCallback are identical apart for the name of the struct. This commit introduces an ExitCallback struct with can be used in both cases to avoid the duplication. PR-URL: https://github.com/nodejs/node/pull/19226 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/env.h b/src/env.h
index 0afd4da37e..2fd3254ed7 100644
--- a/src/env.h
+++ b/src/env.h
@@ -823,17 +823,13 @@ class Environment {
static const int kFsStatsFieldsLength = 2 * 14;
AliasedBuffer<double, v8::Float64Array> fs_stats_field_array_;
- struct BeforeExitCallback {
+ struct ExitCallback {
void (*cb_)(void* arg);
void* arg_;
};
- std::list<BeforeExitCallback> before_exit_functions_;
+ std::list<ExitCallback> before_exit_functions_;
- struct AtExitCallback {
- void (*cb_)(void* arg);
- void* arg_;
- };
- std::list<AtExitCallback> at_exit_functions_;
+ std::list<ExitCallback> at_exit_functions_;
struct PromiseHookCallback {
promise_hook_func cb_;