From 523f43e91a66578a03fc1faeaf8e173b5e46c623 Mon Sep 17 00:00:00 2001 From: antono2 Date: Fri, 11 Sep 2026 04:26:19 +0200 Subject: [PATCH] Release v2.3.0 with antono2.memory --- .github/workflows/test.yml | 6 +++--- CHANGELOG.md | 9 +++++++-- README.md | 6 +++--- block_pool.v | 8 ++++---- upload_ring.v | 10 +++++----- upload_ring_test.v | 8 ++++---- v.mod | 4 ++-- 7 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 744900d..724f743 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,9 +26,9 @@ jobs: path: source/modules/antono2/vulkan - uses: actions/checkout@v7 with: - repository: antono2/mem - ref: v1.0.3 - path: source/modules/antono2/mem + repository: antono2/memory + ref: v1.1.0 + path: source/modules/antono2/memory - uses: prantlf/setup-v-action@v4 - name: Install Vulkan development library run: sudo apt-get update && sudo apt-get install -y libvulkan-dev libvulkan-volk-dev mesa-vulkan-drivers diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aeec22..40e1096 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,15 @@ All notable changes to this project will be documented in this file. +## 2.3.0 - 2026-09-11 + +- Migrate the allocation-policy dependency to the canonical `antono2.memory` + module and pin it to the immutable v1.1.0 release. + ## 2.2.0 - 2026-09-10 -- Migrate the allocation-policy dependency to the canonical `antono2.mem` - module and pin it to the immutable v1.0.3 release. +- Pin the allocation-policy dependency to the immutable v1.0.3 short-name + release, superseded by the canonical dependency in v2.3.0. - Return a local `UploadRingStats` value from `UploadRing.stats()` so the public Vulkan API does not expose the underlying policy module's type. - Share one reference-counted Vulkan mapping across mapped suballocations in the diff --git a/README.md b/README.md index 39fb3f2..53579ee 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,12 @@ enough for examples while avoiding one Vulkan allocation per resource. v install antono2.vkmemalloc ``` -VPM installs the Vulkan bindings and `antono2.mem` dependencies automatically. +VPM installs the Vulkan bindings and `antono2.memory` dependencies automatically. The Vulkan loader, headers, and a working GPU driver must also be installed. -The allocator uses [`antono2.mem`](https://github.com/antono2/mem), -specifically `mem.RangeAllocator`, +The allocator uses [`antono2.memory`](https://github.com/antono2/memory), +specifically `memory.RangeAllocator`, for its dependency-free block suballocation policy. Vulkan handles remain isolated in this module. diff --git a/block_pool.v b/block_pool.v index b5da791..87ffe5d 100644 --- a/block_pool.v +++ b/block_pool.v @@ -1,11 +1,11 @@ module vkmemalloc -import antono2.mem +import antono2.memory struct BlockReservation { owner voidptr block_id u64 - allocation mem.RangeAllocation + allocation memory.RangeAllocation pub: memory_type u32 offset u64 @@ -17,7 +17,7 @@ struct MemoryBlock { memory_type u32 capacity u64 dedicated bool - ranges &mem.RangeAllocator @[required] + ranges &memory.RangeAllocator @[required] } struct BlockPoolStats { @@ -106,7 +106,7 @@ fn (mut pool MemoryBlockPool) add_block_with_policy(memory_type u32, capacity u6 memory_type: memory_type capacity: capacity dedicated: dedicated - ranges: mem.new_range_allocator(capacity) + ranges: memory.new_range_allocator(capacity) } return id } diff --git a/upload_ring.v b/upload_ring.v index d73410d..910337a 100644 --- a/upload_ring.v +++ b/upload_ring.v @@ -1,13 +1,13 @@ module vkmemalloc -import antono2.mem +import antono2.memory import antono2.vulkan as vk // UploadSlice identifies one persistently mapped staging-buffer range. Slices // must be retired in allocation order after the GPU no longer reads them. pub struct UploadSlice { owner voidptr - allocation mem.RingAllocation + allocation memory.RingAllocation pub: offset u64 size u64 @@ -37,8 +37,8 @@ pub: mut: allocator &Allocator = unsafe { nil } backing AllocationInfo - mapped voidptr = unsafe { nil } - ranges &mem.RingAllocator = unsafe { nil } + mapped voidptr = unsafe { nil } + ranges &memory.RingAllocator = unsafe { nil } destroyed bool } @@ -77,7 +77,7 @@ pub fn new_upload_ring(mut allocator Allocator, capacity u64) !&UploadRing { allocator: allocator backing: backing mapped: mapped - ranges: mem.new_ring_allocator(capacity) + ranges: memory.new_ring_allocator(capacity) } } diff --git a/upload_ring_test.v b/upload_ring_test.v index 24fecce..40230d7 100644 --- a/upload_ring_test.v +++ b/upload_ring_test.v @@ -1,13 +1,13 @@ module vkmemalloc -import antono2.mem +import antono2.memory fn test_upload_ring_returns_aligned_host_pointers_and_wraps() { mut storage := []u8{len: 64} mut uploads := UploadRing{ capacity: 64 mapped: storage.data - ranges: mem.new_ring_allocator(64) + ranges: memory.new_ring_allocator(64) } first := uploads.allocate(24, 16) or { panic(err) } second := uploads.allocate(24, 16) or { panic(err) } @@ -37,12 +37,12 @@ fn test_upload_ring_rejects_foreign_forged_and_destroyed_slices() { mut first_ring := UploadRing{ capacity: 32 mapped: first_storage.data - ranges: mem.new_ring_allocator(32) + ranges: memory.new_ring_allocator(32) } mut second_ring := UploadRing{ capacity: 32 mapped: second_storage.data - ranges: mem.new_ring_allocator(32) + ranges: memory.new_ring_allocator(32) } allocation := first_ring.allocate(8, 1) or { panic(err) } foreign := second_ring.allocate(8, 1) or { panic(err) } diff --git a/v.mod b/v.mod index e7a6ddf..4cbee2b 100644 --- a/v.mod +++ b/v.mod @@ -2,9 +2,9 @@ Module { name: 'antono2.vkmemalloc' author: 'Anton Oreskin' description: 'Vulkan block suballocation helpers for buffers and images' - version: '2.2.0' + version: '2.3.0' license: 'MIT' repo_url: 'https://github.com/antono2/vulkan_memory_allocator' tags: ['V','vulkan','allocator'] - dependencies: ['antono2.vulkan','antono2.mem@v1.0.3'] + dependencies: ['antono2.vulkan','antono2.memory@v1.1.0'] }