From 15518175c10b9bf18b21dac0a5b3d6472b525968 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Wed, 4 Jun 2025 16:45:11 -0400 Subject: pkmem.h: debug on bucket + change signatures --- pk.h.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'pk.h.in') diff --git a/pk.h.in b/pk.h.in index 0503415..7e95dd7 100644 --- a/pk.h.in +++ b/pk.h.in @@ -75,20 +75,19 @@ ******************************************************************************** * pkmem.h: def PK_IMPL_MEM before including pk.h to enable ad-hoc. * -* A bucketed memory manager. Allows for the creation and management of up to a -* well-defined number of buckets. +* A bucketed memory manager. Allows for the creation of ad-hoc buckets. * -* Thread safety: Bucket creation and destruction is *not* thread-safe. On the -* other hand, the "pk_new" and "pk_delete" methods *are* thread-safe, but +* Note: Each created pk_membucket MUST call pk_bucket_destroy(bkt). Memory +* buckets are client managed. +* +* Thread safety: "pk_new" and "pk_delete" methods *are* thread-safe, but * thread-safety is implemented per-bucket via a single mutex with long-running * lock times. PRs for a more performant thread-safe strategy are welcome, * complexity and benchmark depending. * * The following definitions (shown with defaults) can be overridden: -* PK_DEFAULT_BUCKET_SIZE 256MB (used when bkt is NULL on first call) +* PK_MEM_DEFAULT_BUCKET_SIZE 256MB (client-convenience only) * PK_MINIMUM_ALIGNMENT 1 -* PK_MAXIMUM_ALIGNMENT 64 -* PK_MAX_BUCKET_COUNT 8 * * For debugging purposes, define the following: * PK_MEMORY_DEBUGGER : enables a tracking system for all allocs and frees to -- cgit v1.2.3