Skip to content

jarnax: serve over-aligned o1heap requests at pool granularity (issue-64) - #65

Merged
emrainey merged 2 commits into
developfrom
issue-64
Aug 30, 2026
Merged

jarnax: serve over-aligned o1heap requests at pool granularity (issue-64)#65
emrainey merged 2 commits into
developfrom
issue-64

Conversation

@emrainey

Copy link
Copy Markdown
Owner

Closes #64

Problem

O1HeapPoolTest.OverAlignedAllocationsAreServedAtMaxAlignment failed in CI on ubuntu (GCC + LLVM) because O1HeapPool::allocate rejected alignment > O1HEAP_ALIGNMENT (16 on 64-bit) with nullptr. With glibc alignof(max_align_t)==16, the test's request 2 * max_align == 32 was rejected. On mac/arm64 max_align_t==8 (2*max_align==16) the guard never tripped, so it only surfaced in CI.

Fix

  • Drop the guard: o1heap serves over-aligned requests at its own O1HEAP_ALIGNMENT granularity — the behavior the test already documented (o1heap.h: The returned pointer is guaranteed to be aligned at O1HEAP_ALIGNMENT).
  • Make the test request deterministic on every platform (sizeof(void*)*4 == 2\u00d7 O1HEAP_ALIGNMENT) so the over-aligned path is always exercised.

Checks

AI (opencode, big-pickle): guard removal + deterministic test request. Human: original failing test.

  • on-host-native-llvm 21/21
  • on-host-native-clang 21/21
  • on-target-cortex-m4-gcc-arm-none-eabi workflow
  • on-target-cortex-m7-gcc-arm-none-eabi workflow

…-64)

AI work (opencode, big-pickle):
- Removed the alignment > O1HEAP_ALIGNMENT rejection in
  O1HeapPool::allocate that returned nullptr; o1heap serves such
  requests at its own (O1HEAP_ALIGNMENT) granularity, matching the
  behavior the test documents. CI (glibc, max_align_t=16) was rejecting
  2*max_align=32 requests while local mac/arm64 (max_align_t=8, request
  16) never tripped the guard.
- Made the over-aligned request deterministic on all hosts
  (sizeof(void*)*4 == 2x O1HEAP_ALIGNMENT) so the path is always
  exercised; all presets green (llvm/clang 21/21, m4/m7 cross).

Human work: authored the original failing over-aligned test.
AI work (opencode, big-pickle):
- Renamed the four local Node declarations that shadowed the fixture
  member 'node' in gtest-cyphal-node.cpp, fixing the GCC
  -Werror=shadow failure on the native Linux GCC CI job (Clang does not
  warn for class-member shadowing). Local renamed to constructed_node
  and its references updated.
Human work: original test file.
@emrainey
emrainey merged commit 14ffd40 into develop Aug 30, 2026
4 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.

1 participant