aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe-php-shim/src/runtime.rs13
-rw-r--r--crates/shirabe/src/installer.rs17
2 files changed, 4 insertions, 26 deletions
diff --git a/crates/shirabe-php-shim/src/runtime.rs b/crates/shirabe-php-shim/src/runtime.rs
index 6ad5bc29..e24d6d69 100644
--- a/crates/shirabe-php-shim/src/runtime.rs
+++ b/crates/shirabe-php-shim/src/runtime.rs
@@ -394,19 +394,6 @@ pub fn ini_set(_varname: &str, _value: &str) -> Option<String> {
todo!()
}
-pub fn gc_collect_cycles() -> i64 {
- // Rust has no cycle collector; nothing is collected.
- 0
-}
-
-pub fn gc_disable() {
- // Rust has no cycle collector to disable.
-}
-
-pub fn gc_enable() {
- // Rust has no cycle collector to enable.
-}
-
pub fn phpinfo(_what: i64) {
// TODO(php-runtime): phpinfo() dumps the full PHP runtime configuration, which the shim does not
// model.
diff --git a/crates/shirabe/src/installer.rs b/crates/shirabe/src/installer.rs
index 702569aa..22da3fff 100644
--- a/crates/shirabe/src/installer.rs
+++ b/crates/shirabe/src/installer.rs
@@ -36,8 +36,8 @@ use indexmap::IndexMap;
use shirabe_external_packages::seld::json_lint::ParsingException;
use shirabe_php_shim::{
- PhpMixed, RuntimeException, array_map, array_unique, defined, gc_collect_cycles, gc_disable,
- gc_enable, implode, intval, is_dir, is_numeric, strcmp, strpos, strtolower, touch, usort,
+ PhpMixed, RuntimeException, array_map, array_unique, implode, intval, is_dir, is_numeric,
+ strcmp, strpos, strtolower, touch, usort,
};
use shirabe_semver;
@@ -219,12 +219,8 @@ impl Installer {
/// Run installation (or update)
#[tracing::instrument(skip_all)]
pub fn run(&mut self) -> anyhow::Result<i64> {
- // Disable GC to save CPU cycles, as the dependency solver can create hundreds of thousands
- // of PHP objects, the GC can spend quite some time walking the tree of references looking
- // for stuff to collect while there is nothing to collect. This slows things down dramatically
- // and turning it off results in much better performance. Do not try this at home however.
- gc_collect_cycles();
- gc_disable();
+ // Composer disables GC to save CPU cycles, but Shirabe does not as Rust has no GC.
+ // It is possible to disable GC in PHP via RPC, but it might not be effective.
if self.update_allow_list.is_some() && self.update_mirrors {
return Err(RuntimeException::new(
@@ -478,11 +474,6 @@ impl Installer {
);
}
- // re-enable GC except on HHVM which triggers a warning here
- if !defined("HHVM_VERSION") {
- gc_enable();
- }
-
let audit_config = self.get_audit_config()?.clone();
if audit_config.audit {