From bf79987433e8b2457007a8f531e4a0b3112ed466 Mon Sep 17 00:00:00 2001 From: Tyler Ang-Wanek Date: Wed, 20 Jan 2021 07:14:18 -0700 Subject: [PATCH] src: mark internally exported functions as explicitly internal PR-URL: https://github.com/nodejs/node/pull/37000 Fixes: https://github.com/nodejs/node/issues/36349 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: James M Snell --- src/api/hooks.cc | 4 ++-- src/node.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/api/hooks.cc b/src/api/hooks.cc index 514706d4c87c30..cb46c5c1b87643 100644 --- a/src/api/hooks.cc +++ b/src/api/hooks.cc @@ -145,7 +145,7 @@ static void RunAsyncCleanupHook(void* arg) { info->fun(info->arg, FinishAsyncCleanupHook, info); } -ACHHandle* AddEnvironmentCleanupHookRaw( +ACHHandle* AddEnvironmentCleanupHookInternal( Isolate* isolate, AsyncCleanupHook fun, void* arg) { @@ -160,7 +160,7 @@ ACHHandle* AddEnvironmentCleanupHookRaw( return new ACHHandle { info }; } -void RemoveEnvironmentCleanupHookRaw( +void RemoveEnvironmentCleanupHookInternal( ACHHandle* handle) { if (handle->info->started) return; handle->info->self.reset(); diff --git a/src/node.h b/src/node.h index 74d22b25f03510..4348dfba5b2be8 100644 --- a/src/node.h +++ b/src/node.h @@ -925,7 +925,9 @@ struct ACHHandle; struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; }; typedef std::unique_ptr AsyncCleanupHookHandle; -NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookRaw( +/* This function is not intended to be used externally, it exists to aid in + * keeping ABI compatibility between Node and Electron. */ +NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookInternal( v8::Isolate* isolate, void (*fun)(void* arg, void (*cb)(void*), void* cbarg), void* arg); @@ -933,13 +935,15 @@ inline AsyncCleanupHookHandle AddEnvironmentCleanupHook( v8::Isolate* isolate, void (*fun)(void* arg, void (*cb)(void*), void* cbarg), void* arg) { - return AsyncCleanupHookHandle(AddEnvironmentCleanupHookRaw(isolate, fun, + return AsyncCleanupHookHandle(AddEnvironmentCleanupHookInternal(isolate, fun, arg)); } -NODE_EXTERN void RemoveEnvironmentCleanupHookRaw(ACHHandle* holder); +/* This function is not intended to be used externally, it exists to aid in + * keeping ABI compatibility between Node and Electron. */ +NODE_EXTERN void RemoveEnvironmentCleanupHookInternal(ACHHandle* holder); inline void RemoveEnvironmentCleanupHook(AsyncCleanupHookHandle holder) { - RemoveEnvironmentCleanupHookRaw(holder.get()); + RemoveEnvironmentCleanupHookInternal(holder.get()); } /* Returns the id of the current execution context. If the return value is