Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changes

## 0.41.0

- Move the ownership-safe fixed-ring RChan implementation and its regression
suite to Sigils 0.31.0; keep a compatibility import for existing FigDraw
callers and exercise image-message replacement through the shared channel.

- Store `RChan` messages in a fixed typed ring, transferring isolated values
with `swap` under the lock. Remove per-message allocations and send rollback;
preserve `tryTake` sources on failure and receive isolated values directly.
Initialize vacant slots without constructing payload field defaults.
- Release image-message subscription channels and all ring storage. Run payload
hooks outside channel locks and reject reentrant operations during teardown.
- Add Linux/macOS RSS regressions covering both `tryRecv` and blocking `recv`.

## 0.40.2

- Export producer-owned `RenderFragments`, fragment handles, cursors, and their
Expand Down
3 changes: 2 additions & 1 deletion figdraw.nimble
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
version = "0.40.2"
version = "0.41.0"
author = "Jaremy Creechley"
description = "UI Engine for Nim"
license = "MIT"
srcDir = "src"

# Dependencies
requires "nim >= 2.2"
requires "https://github.com/elcritch/sigils#feat/rchannels"
requires "pixie >= 5.0.1"
requires "chroma >= 0.2.7"
requires "bumpy"
Expand Down
8 changes: 6 additions & 2 deletions src/figdraw/common/imgutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import std/[isolation, locks, times]
import pkg/pixie
import chronicles

import ./rchannels
import sigils/rchannels
import ./formatflippy
import ./fonttypes
import ./shared
Expand Down Expand Up @@ -108,10 +108,14 @@ imageCachedLock.initLock()
ownerTokenLock.initLock()
imageSubscriberLock.initLock()

proc `=destroy`(subscription: ImageMessageSubscriptionHandle) =
proc `=destroy`(subscription: var ImageMessageSubscriptionHandle) =
if subscription.id != 0'u64:
withLock imageSubscriberLock:
imageSubscribers.del(subscription.id)
# This custom destructor replaces the compiler-generated field cleanup.
# Release the subscription's channel owner after removing the table owner;
# queued ImageMsg values then get destroyed by RChan's final-owner cleanup.
`=destroy`(subscription.inbox)

proc `==`*(a, b: ImageId): bool {.borrow.}
proc `==`*(a, b: OwnerToken): bool {.borrow.}
Expand Down
Loading
Loading