diff options
author | Tyler Ang-Wanek <tylerw@axosoft.com> | 2021-01-19 17:39:14 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2021-01-24 22:12:03 +0300 |
commit | 1fe571aa0c55814e58f6efefedf69da8d358034b (patch) | |
tree | 95e1529084f5b7b08224887997a6f16cd21c8a4c /src/node.h | |
parent | a87190b00c8862b980dfd6607e28455bef6297e9 (diff) |
src: inline AsyncCleanupHookHandle in headers
Fixes: https://github.com/nodejs/node/issues/36349
PR-URL: https://github.com/nodejs/node/pull/37000
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node.h')
-rw-r--r-- | src/node.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/node.h b/src/node.h index 5313f49e0bc..74d22b25f03 100644 --- a/src/node.h +++ b/src/node.h @@ -925,12 +925,22 @@ struct ACHHandle; struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; }; typedef std::unique_ptr<ACHHandle, DeleteACHHandle> AsyncCleanupHookHandle; -NODE_EXTERN AsyncCleanupHookHandle AddEnvironmentCleanupHook( +NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookRaw( v8::Isolate* isolate, void (*fun)(void* arg, void (*cb)(void*), void* cbarg), void* arg); +inline AsyncCleanupHookHandle AddEnvironmentCleanupHook( + v8::Isolate* isolate, + void (*fun)(void* arg, void (*cb)(void*), void* cbarg), + void* arg) { + return AsyncCleanupHookHandle(AddEnvironmentCleanupHookRaw(isolate, fun, + arg)); +} -NODE_EXTERN void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder); +NODE_EXTERN void RemoveEnvironmentCleanupHookRaw(ACHHandle* holder); +inline void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder) { + RemoveEnvironmentCleanupHookRaw(holder.get()); +} /* Returns the id of the current execution context. If the return value is * zero then no execution has been set. This will happen if the user handles |