Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: rename heapStats to memoryUsage #9986

Merged
merged 7 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
runtime: export Deno.memoryUsage()
  • Loading branch information
AaronO committed Apr 4, 2021
commit a493d7f3d5b599051e95f7d3cca2331b64a93f15
10 changes: 10 additions & 0 deletions cli/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2311,4 +2311,14 @@ declare namespace Deno {
newpath: string,
options?: SymlinkOptions,
): Promise<void>;

export interface MemoryUsage {
rss: number;
heapTotal: number;
heapUsed: number;
external: number;
arrayBuffers: number;
}

export function memoryUsage(): MemoryUsage;
}
2 changes: 1 addition & 1 deletion cli/tests/heapstats.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function allocTest(alloc, allocAssert, deallocAssert) {
const sample = () => {
// deno-lint-ignore no-undef
gc();
return Deno.core.memoryUsage();
return Deno.memoryUsage();
};
const delta = (t1, t2) => t2.heapUsed - t1.heapUsed;

Expand Down
1 change: 1 addition & 0 deletions runtime/js/99_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ delete Object.prototype.__proto__;
[internalSymbol]: internals,
resources: core.resources,
close: core.close,
memoryUsage: core.memoryUsage,
...denoNs,
};
Object.defineProperties(finalDenoNs, {
Expand Down