0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-28 06:28:40 +01:00
nodejs/typings/internalBinding/debug.d.ts
Michaël Zasso 1d35a066e7
src,test: ensure that V8 fast APIs are called
Adds a debug-only macro that can be used to track when a V8 fast API is
called. A map of counters is maintained in in thread-local storage and
an internal API can be called to get the total count associated with
a call id.
Specific tests are added and `crypto.timingSafeEqual` as well as
internal documentation are updated to show how to use the macro
and test fast API calls without running long loops.

PR-URL: https://github.com/nodejs/node/pull/54317
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2024-08-13 12:37:02 +00:00

11 lines
356 B
TypeScript

/**
* The `internalBinding('debug')` binding provides access to internal debugging
* utilities. They are only available when Node.js is built with the `--debug`
* or `--debug-node` compile-time flags.
*/
export interface DebugBinding {
getV8FastApiCallCount(name: string): number;
isEven(value: number): boolean;
isOdd(value: number): boolean;
}