summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/diagnostics.rs2
-rw-r--r--cli/dts/lib.deno.ns.d.ts43
-rw-r--r--cli/dts/lib.deno.unstable.d.ts45
-rw-r--r--runtime/js/90_deno_ns.js2
-rw-r--r--runtime/ops/os/mod.rs1
5 files changed, 44 insertions, 49 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs
index 59c7f9737..0fd8a0c5c 100644
--- a/cli/diagnostics.rs
+++ b/cli/diagnostics.rs
@@ -18,7 +18,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"CreateHttpClientOptions",
"DatagramConn",
"HttpClient",
- "SystemMemoryInfo",
"UnixConnectOptions",
"UnixListenOptions",
"bench",
@@ -31,7 +30,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"ppid",
"removeSignalListener",
"shutdown",
- "systemMemoryInfo",
"umask",
"spawnChild",
"Child",
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts
index b64e78af2..43c46754b 100644
--- a/cli/dts/lib.deno.ns.d.ts
+++ b/cli/dts/lib.deno.ns.d.ts
@@ -369,6 +369,49 @@ declare namespace Deno {
*/
export function networkInterfaces(): NetworkInterfaceInfo[];
+ /**
+ * Displays the total amount of free and used physical and swap memory in the
+ * system, as well as the buffers and caches used by the kernel.
+ *
+ * This is similar to the `free` command in Linux
+ *
+ * ```ts
+ * console.log(Deno.systemMemoryInfo());
+ * ```
+ *
+ * Requires `allow-sys` permission.
+ *
+ * @tags allow-sys
+ * @category Runtime Environment
+ */
+ export function systemMemoryInfo(): SystemMemoryInfo;
+
+ /**
+ * Information returned from a call to {@linkcode Deno.systemMemoryInfo}.
+ *
+ * @category Runtime Environment
+ */
+ export interface SystemMemoryInfo {
+ /** Total installed memory in bytes. */
+ total: number;
+ /** Unused memory in bytes. */
+ free: number;
+ /** Estimation of how much memory, in bytes, is available for starting new
+ * applications, without swapping. Unlike the data provided by the cache or
+ * free fields, this field takes into account page cache and also that not
+ * all reclaimable memory will be reclaimed due to items being in use.
+ */
+ available: number;
+ /** Memory used by kernel buffers. */
+ buffers: number;
+ /** Memory used by the page cache and slabs. */
+ cached: number;
+ /** Total swap memory. */
+ swapTotal: number;
+ /** Unused swap memory. */
+ swapFree: number;
+ }
+
/** Reflects the `NO_COLOR` environment variable at program start.
*
* When the value is `true`, the Deno CLI will attempt to not send color codes
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts
index 6c8497cec..94fc0b5d6 100644
--- a/cli/dts/lib.deno.unstable.d.ts
+++ b/cli/dts/lib.deno.unstable.d.ts
@@ -271,51 +271,6 @@ declare namespace Deno {
/** **UNSTABLE**: New API, yet to be vetted.
*
- * Displays the total amount of free and used physical and swap memory in the
- * system, as well as the buffers and caches used by the kernel.
- *
- * This is similar to the `free` command in Linux
- *
- * ```ts
- * console.log(Deno.systemMemoryInfo());
- * ```
- *
- * Requires `allow-sys` permission.
- *
- * @tags allow-sys
- * @category Runtime Environment
- */
- export function systemMemoryInfo(): SystemMemoryInfo;
-
- /** **UNSTABLE**: New API, yet to be vetted.
- *
- * Information returned from a call to {@linkcode Deno.systemMemoryInfo}.
- *
- * @category Runtime Environment
- */
- export interface SystemMemoryInfo {
- /** Total installed memory in bytes. */
- total: number;
- /** Unused memory in bytes. */
- free: number;
- /** Estimation of how much memory, in bytes, is available for starting new
- * applications, without swapping. Unlike the data provided by the cache or
- * free fields, this field takes into account page cache and also that not
- * all reclaimable memory will be reclaimed due to items being in use.
- */
- available: number;
- /** Memory used by kernel buffers. */
- buffers: number;
- /** Memory used by the page cache and slabs. */
- cached: number;
- /** Total swap memory. */
- swapTotal: number;
- /** Unused swap memory. */
- swapFree: number;
- }
-
- /** **UNSTABLE**: New API, yet to be vetted.
- *
* Returns the user id of the Deno process on POSIX platforms. Returns `null`
* on Windows.
*
diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js
index a0587c7f6..8111698be 100644
--- a/runtime/js/90_deno_ns.js
+++ b/runtime/js/90_deno_ns.js
@@ -121,13 +121,13 @@
unrefTimer: __bootstrap.timers.unrefTimer,
osRelease: __bootstrap.os.osRelease,
hostname: __bootstrap.os.hostname,
+ systemMemoryInfo: __bootstrap.os.systemMemoryInfo,
networkInterfaces: __bootstrap.os.networkInterfaces,
consoleSize: __bootstrap.tty.consoleSize,
};
__bootstrap.denoNsUnstable = {
DiagnosticCategory: __bootstrap.diagnostics.DiagnosticCategory,
- systemMemoryInfo: __bootstrap.os.systemMemoryInfo,
gid: __bootstrap.os.gid,
uid: __bootstrap.os.uid,
listenDatagram: __bootstrap.net.listenDatagram,
diff --git a/runtime/ops/os/mod.rs b/runtime/ops/os/mod.rs
index 275461cc1..1bc140d44 100644
--- a/runtime/ops/os/mod.rs
+++ b/runtime/ops/os/mod.rs
@@ -245,7 +245,6 @@ impl From<netif::Interface> for NetworkInterface {
fn op_system_memory_info(
state: &mut OpState,
) -> Result<Option<sys_info::MemInfo>, AnyError> {
- super::check_unstable(state, "Deno.systemMemoryInfo");
state
.borrow_mut::<Permissions>()
.sys