Skip to content

Commit

Permalink
Fix compilation error when building with pool_memalign in release mode (
Browse files Browse the repository at this point in the history
#4455)

Fixes #4431
  • Loading branch information
SeanTAllen committed Oct 3, 2023
1 parent 57f7f1e commit 20c15ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,12 @@ jobs:
include:
- image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230924
debugger: lldb
directive: dtrace
directives: dtrace
- image: ghcr.io/ponylang/ponyc-ci-x86-64-unknown-linux-ubuntu22.04-builder:20230924
debugger: lldb
directives: pool_memalign

name: use ${{ matrix.directive }}
name: use ${{ matrix.directives }}
container:
image: ${{ matrix.image }}
options: --user pony --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
Expand All @@ -437,13 +440,13 @@ jobs:
key: libs-${{ matrix.image }}-${{ hashFiles('Makefile', 'CMakeLists.txt', 'libs/CMakeLists.txt') }}
- name: Build Debug Runtime
run: |
make configure arch=x86-64 config=debug use=${{ matrix.directive }}
make configure arch=x86-64 config=debug use=${{ matrix.directives }}
make build config=debug
- name: Test with Debug Runtime
run: make test-ci config=debug usedebugger='${{ matrix.debugger }}'
- name: Build Release Runtime
run: |
make configure arch=x86-64 config=release use=${{ matrix.directive }}
make configure arch=x86-64 config=release use=${{ matrix.directives }}
make build config=release
- name: Test with Release Runtime
Expand Down
3 changes: 3 additions & 0 deletions .release-notes/fix-4431.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Fix compilation error when building with pool_memalign in release mode

When attempting to build the Pony runtime with the `pool_memalign` option, users would encounter a compilation error if building a `release` rather than `debug` version of the runtime. We've fixed the compilation error and added CI testing to verify we don't get a regression.
3 changes: 3 additions & 0 deletions src/libponyrt/mem/pool_memalign.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void* ponyint_pool_alloc(size_t index)
else
{
int code = posix_memalign(&p, POOL_ALIGN, size);
(void)code;
pony_assert(code == 0);
}

Expand All @@ -35,6 +36,7 @@ void* ponyint_pool_alloc(size_t index)

void ponyint_pool_free(size_t index, void* p)
{
(void)index;
pony_assert(index < POOL_COUNT);

free(p);
Expand All @@ -44,6 +46,7 @@ static void* pool_alloc_size(size_t size)
{
void* p;
int code = posix_memalign(&p, POOL_ALIGN, size);
(void)code;
pony_assert(code == 0);

return p;
Expand Down

0 comments on commit 20c15ff

Please sign in to comment.