From 9c32689e576906332d2ceaabafc2a927d152beba Mon Sep 17 00:00:00 2001 From: Kevin Svetlitski Date: Thu, 18 May 2023 10:13:59 -0700 Subject: [PATCH] Fix bug where hpa_shard was not being destroyed It appears that this was a simple mistake where `hpa_shard_disable` was being called instead of `hpa_shard_destroy`. At present `hpa_shard_destroy` is not called anywhere at all outside of test-cases, which further suggests that this is a bug. @davidtgoldblatt noted however that since HPA is disabled for manual arenas and we don't support destruction for auto arenas that presently there is no way to actually trigger this bug. Nonetheless, it should be fixed. --- src/pa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pa.c b/src/pa.c index eb7e4620..18c850d7 100644 --- a/src/pa.c +++ b/src/pa.c @@ -108,7 +108,7 @@ pa_shard_destroy(tsdn_t *tsdn, pa_shard_t *shard) { pac_destroy(tsdn, &shard->pac); if (shard->ever_used_hpa) { sec_flush(tsdn, &shard->hpa_sec); - hpa_shard_disable(tsdn, &shard->hpa_shard); + hpa_shard_destroy(tsdn, &shard->hpa_shard); } }