Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation error when building with pool_memalign in release mode #4455

Merged
merged 1 commit into from
Oct 3, 2023
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
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
Loading