aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/runtime.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-04 20:57:08 +0900
committernsfisis <nsfisis@gmail.com>2026-07-04 20:57:08 +0900
commit6ba0a31ddfd68ecf8359f8276574bfe9bd5de5fa (patch)
tree4adaee932c86f28fca58c645459a65e777c0ee47 /crates/shirabe-php-shim/src/runtime.rs
parentbc17a09fc84d146b7d91401a2998ceef10c8a2ec (diff)
downloadphp-shirabe-6ba0a31ddfd68ecf8359f8276574bfe9bd5de5fa.tar.gz
php-shirabe-6ba0a31ddfd68ecf8359f8276574bfe9bd5de5fa.tar.zst
php-shirabe-6ba0a31ddfd68ecf8359f8276574bfe9bd5de5fa.zip
feat(php-shim): stub memory_get_usage/memory_get_peak_usage to return 0
Diffstat (limited to 'crates/shirabe-php-shim/src/runtime.rs')
-rw-r--r--crates/shirabe-php-shim/src/runtime.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs
index 786f3f5..91de9e4 100644
--- a/crates/shirabe-php-shim/src/runtime.rs
+++ b/crates/shirabe-php-shim/src/runtime.rs
@@ -474,14 +474,13 @@ pub fn r#eval(_code: &str) -> PhpMixed {
}
pub fn memory_get_usage() -> i64 {
- // TODO(phase-d): PHP reports memory tracked by its own allocator (emalloc); Rust has no
- // equivalent accounting, and process RSS would not match PHP's semantics.
- todo!()
+ // TODO(phase-d): return PHP's actual emalloc-tracked memory usage instead of a stub 0.
+ 0
}
pub fn memory_get_peak_usage(_real_usage: bool) -> i64 {
- // TODO(phase-d): see memory_get_usage; PHP's peak emalloc figure has no Rust equivalent.
- todo!()
+ // TODO(phase-d): return PHP's actual emalloc-tracked peak memory usage instead of a stub 0.
+ 0
}
pub fn call_user_func<T>(_callback: &str, _args: &[PhpMixed]) -> T