Skip to content

fix(allocator): Allocator::from_raw_parts do not use const assertion for endianness test#10888

Merged
graphite-app[bot] merged 1 commit intomainfrom
05-08-fix_allocator_allocator_from_raw_parts_do_not_use_const_assertion_for_endianness_test
May 8, 2025
Merged

fix(allocator): Allocator::from_raw_parts do not use const assertion for endianness test#10888
graphite-app[bot] merged 1 commit intomainfrom
05-08-fix_allocator_allocator_from_raw_parts_do_not_use_const_assertion_for_endianness_test

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented May 8, 2025

Currently we panic at compile time if attempt to compile oxc_allocator with from_raw_parts feature enabled on a big-endian system. Instead, panic at runtime.

This will allow napi/parser to be built on big endian systems.

The panic will still be optimized out on little-endian systems, and napi/parser will not use raw transfer on big endian, so Allocator::from_raw_parts won't be called, so this panic should never occur. But the check ensures the soundness of Allocator::from_raw_parts.

@github-actions github-actions bot added the C-bug Category - Bug label May 8, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented May 8, 2025

CodSpeed Instrumentation Performance Report

Merging #10888 will not alter performance

Comparing 05-08-fix_allocator_allocator_from_raw_parts_do_not_use_const_assertion_for_endianness_test (446d9b3) with main (79819cc)

Summary

✅ 36 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review May 8, 2025 11:30
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label May 8, 2025
Copy link
Member

Dunqing commented May 8, 2025

Merge activity

…n for endianness test (#10888)

Currently we panic at compile time if attempt to compile `oxc_allocator` with `from_raw_parts` feature enabled on a big-endian system. Instead, panic at runtime.

This will allow `napi/parser` to be built on big endian systems.

The panic will still be optimized out on little-endian systems, and `napi/parser` will not use raw transfer on big endian, so `Allocator::from_raw_parts` won't be called, so this panic should never occur. But the check ensures the soundness of `Allocator::from_raw_parts`.
@graphite-app graphite-app bot force-pushed the 05-08-fix_allocator_allocator_from_raw_parts_do_not_use_const_assertion_for_endianness_test branch from c5c8f23 to 446d9b3 Compare May 8, 2025 11:43
@graphite-app graphite-app bot merged commit 446d9b3 into main May 8, 2025
26 checks passed
@graphite-app graphite-app bot deleted the 05-08-fix_allocator_allocator_from_raw_parts_do_not_use_const_assertion_for_endianness_test branch May 8, 2025 11:49
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants