fix(bindings): add SafeHandleWrapper + memory growth checks; bump 0.9.1 (#571)

- Introduce SafeHandleWrapper with gating, short drain wait, and deferred release on last in-flight exit.
- Wire Engine/Program/Rvm/CompiledPolicy to wrapper (centralized handle use, interop helper).
- Add C# memory growth tests (using/finalizer paths) and extend xtask C# runner options.
- Add pooled marshalling utilities, ResultHelpers, and API cleanups; update versions/changelog.

Fixes #570. Closes #554

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2026-02-09 23:52:05 +05:30
committed by GitHub
parent 455d2aa588
commit 96360fa9d8
39 changed files with 1496 additions and 1151 deletions
+3
View File
@@ -135,6 +135,9 @@ impl TestAllBindingsCommand {
enforce_artifacts: false,
force_nuget: false,
nuget_dir: None,
test_filter: None,
skip_apps: false,
console_logger: false,
}
.run()?;
+31
View File
@@ -308,6 +308,18 @@ pub struct TestCsharpCommand {
/// Restore and test using Regorus NuGet artefacts located at DIR. Defaults to bindings/csharp/Regorus/bin/<configuration>.
#[arg(long = "nuget-dir", value_name = "DIR")]
pub nuget_dir: Option<PathBuf>,
/// Optional dotnet test filter to apply when running Regorus.Tests.
#[arg(long = "test-filter", value_name = "FILTER")]
pub test_filter: Option<String>,
/// Skip building/running the C# sample apps (TestApp, TargetExampleApp).
#[arg(long = "skip-apps")]
pub skip_apps: bool,
/// Emit console logger output for dotnet test.
#[arg(long = "console-logger")]
pub console_logger: bool,
}
impl TestCsharpCommand {
@@ -412,6 +424,9 @@ impl TestCsharpCommand {
&package_dir,
self.clean,
&package_cache,
self.test_filter.as_deref(),
self.skip_apps,
self.console_logger,
)?;
Ok(())
@@ -424,6 +439,9 @@ fn run_regorus_tests(
package_dir: &Path,
clean: bool,
package_cache: &Path,
test_filter: Option<&str>,
skip_apps: bool,
console_logger: bool,
) -> Result<()> {
let nuget_source = package_dir
.to_str()
@@ -457,9 +475,22 @@ fn run_regorus_tests(
test.arg(configuration);
test.arg("--arch");
test.arg(dotnet_host_arch());
if console_logger {
test.arg("--logger");
test.arg("console;verbosity=detailed");
}
if let Some(filter) = test_filter {
test.arg("--");
test.arg("--filter");
test.arg(filter);
}
test.env("NUGET_PACKAGES", package_cache);
run_command(test, "dotnet test (Regorus.Tests)")?;
if skip_apps {
return Ok(());
}
let test_app = workspace.join("bindings/csharp/TestApp");
if clean {
clean_msbuild_project(&test_app)?;