Skip to content

Commit

Permalink
src: mark internally exported functions as explicitly internal
Browse files Browse the repository at this point in the history
PR-URL: #37000
Fixes: #36349
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
implausible authored and jasnell committed Jan 24, 2021
1 parent 1fe571a commit bf79987
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/api/hooks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down
12 changes: 8 additions & 4 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -925,21 +925,25 @@ struct ACHHandle;
struct NODE_EXTERN DeleteACHHandle { void operator()(ACHHandle*) const; };
typedef std::unique_ptr<ACHHandle, DeleteACHHandle> 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);
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
Expand Down

0 comments on commit bf79987

Please sign in to comment.