replace allocator with mimalloc (works for cli/fpm, embed needs to be tested)

This commit is contained in:
Marc Henderkes
2025-03-20 06:22:11 +01:00
parent 6447fec028
commit 92470a35da
2 changed files with 5 additions and 4 deletions

View File

@@ -150,12 +150,13 @@ class LinuxBuilder extends UnixBuilderBase
$enable_micro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO; $enable_micro = ($build_target & BUILD_TARGET_MICRO) === BUILD_TARGET_MICRO;
$enable_embed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED; $enable_embed = ($build_target & BUILD_TARGET_EMBED) === BUILD_TARGET_EMBED;
$mimalloc = $this->getLib('mimalloc') !== null ? BUILD_LIB_PATH . '/mimalloc.o ' : '';
// prepare build php envs // prepare build php envs
$envs_build_php = SystemUtil::makeEnvVarString([ $envs_build_php = SystemUtil::makeEnvVarString([
'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'), 'CFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CFLAGS'),
'CPPFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS'), 'CPPFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_CPPFLAGS'),
'LDFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS'), 'LDFLAGS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LDFLAGS'),
'LIBS' => getenv('SPC_CMD_VAR_PHP_CONFIGURE_LIBS'), 'LIBS' => $mimalloc . getenv('SPC_CMD_VAR_PHP_CONFIGURE_LIBS'),
]); ]);
// process micro upx patch if micro sapi enabled // process micro upx patch if micro sapi enabled

View File

@@ -24,7 +24,7 @@ trait mimalloc
$args .= '-DMI_INSTALL_TOPLEVEL=ON '; $args .= '-DMI_INSTALL_TOPLEVEL=ON ';
FileSystem::resetDir($this->source_dir . '/build'); FileSystem::resetDir($this->source_dir . '/build');
shell()->cd($this->source_dir . '/build') shell()->cd($this->source_dir . '/build')
->exec( ->execWithEnv(
'cmake ' . 'cmake ' .
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' . '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
"-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " .
@@ -32,7 +32,7 @@ trait mimalloc
$args . $args .
'..' '..'
) )
->exec("make -j{$this->builder->concurrency}") ->execWithEnv("make -j{$this->builder->concurrency}")
->exec('make install'); ->execWithEnv('make install');
} }
} }