diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3ce87b236..1eca559137 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -905,6 +905,30 @@ jobs: run: | bake run test/cpp --cfg sanitize -- -j 8 + test-os-alloc-core: + needs: [ build-linux ] + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: [ ubuntu-20.04 ] + + steps: + - uses: actions/checkout@v4 + - name: install bake + run: | + git clone https://github.com/SanderMertens/bake + make -C bake/build-$(uname) + bake/bake setup + + - name: build flecs + run: bake --cfg sanitize -D FLECS_USE_OS_ALLOC + + - name: run tests + run: | + bake run test/core --cfg sanitize -- -j 8 + test-cmake: needs: [ build-linux, build-macos ] runs-on: ${{ matrix.os }} diff --git a/distr/flecs.c b/distr/flecs.c index 85a0ac9609..0d8acbb65e 100644 --- a/distr/flecs.c +++ b/distr/flecs.c @@ -36016,12 +36016,12 @@ void flecs_id_record_free( world->id_index_lo[hash] = NULL; } - flecs_bfree(&world->allocators.id_record, idr); - #ifdef FLECS_DEBUG_INFO ecs_os_free(idr->str); #endif + flecs_bfree(&world->allocators.id_record, idr); + if (ecs_should_log_1()) { char *id_str = ecs_id_str(world, id); ecs_dbg_1("#[green]id#[normal] %s #[red]deleted", id_str); diff --git a/src/storage/id_index.c b/src/storage/id_index.c index f8e8603967..e7d7a43bd3 100644 --- a/src/storage/id_index.c +++ b/src/storage/id_index.c @@ -486,12 +486,12 @@ void flecs_id_record_free( world->id_index_lo[hash] = NULL; } - flecs_bfree(&world->allocators.id_record, idr); - #ifdef FLECS_DEBUG_INFO ecs_os_free(idr->str); #endif + flecs_bfree(&world->allocators.id_record, idr); + if (ecs_should_log_1()) { char *id_str = ecs_id_str(world, id); ecs_dbg_1("#[green]id#[normal] %s #[red]deleted", id_str);