Skip to content

hal: a stream of depth N holds N samples - #4678

Merged
BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:hal-stream-depth
Oct 14, 2026
Merged

BsAtHome merged 1 commit into
LinuxCNC:masterfrom
grandixximo:hal-stream-depth

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

A HAL stream keeps one slot free to tell a full ring from an empty one, so a stream created with depth N held only N-1 samples. It now allocates N+1 slots, holds N, and still reports N as maxdepth.

histobinstream and latencybinstream added 1 to their depth to work around this; that is removed. tests/halmodule/stream asserted the old capacity and now fills a depth 10 stream with 10 samples.

@BsAtHome found this in #4674 and asked for it to be its own PR.

The ring keeps one slot free to tell full from empty, so a stream
created with depth N took only N-1 samples. Allocate N+1 slots and keep
reporting N as maxdepth. Drop the +1 that histobinstream and
latencybinstream added for it, and fill the halmodule stream test to
10. Found by Bertho Stultiens in LinuxCNC#4674.
@BsAtHome
BsAtHome merged commit 9123139 into LinuxCNC:master Oct 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants