Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 14, 2025

Follow-on after #9656. Add a defence against potential double-free bug in String::from_utf8_unchecked.

As noted in the comment, this is probably unnecessary, but it doesn't hurt to add this defensive code while new Vec implementation is under development. We can remove it again later when we're satisfied we have covered all bases.

Copy link
Member Author

overlookmotel commented Mar 14, 2025


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.

@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Mar 14, 2025
@overlookmotel overlookmotel marked this pull request as ready for review March 14, 2025 06:28
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 14, 2025

CodSpeed Performance Report

Merging #9772 will create unknown performance changes

Comparing 03-14-refactor_allocator_improve_safety_of_string_from_utf8_unchecked_ (d13817e) with main (a1a8b93)

Summary

🆕 33 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 22.6 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 65.7 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 57.6 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 20.9 µs N/A
🆕 lexer[antd.js] N/A 24.1 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.7 ms N/A
🆕 lexer[checker.ts] N/A 14.5 ms N/A
🆕 lexer[pdf.mjs] N/A 3.8 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 3 s N/A
🆕 mangler[antd.js] N/A 15.9 ms N/A
🆕 mangler[react.development.js] N/A 293.1 µs N/A
🆕 mangler[typescript.js] N/A 39.4 ms N/A
🆕 minifier[antd.js] N/A 163.8 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 289.4 ms N/A
🆕 estree[checker.ts] N/A 87.4 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 91.5 µs N/A
🆕 parser[antd.js] N/A 113.4 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Mar 14, 2025
Copy link
Member

Dunqing commented Mar 14, 2025

Merge activity

  • Mar 14, 2:44 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 14, 2:44 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 14, 2:56 AM EDT: A user merged this pull request with the Graphite merge queue.

…9772)

Follow-on after #9656. Add a defence against potential double-free bug in `String::from_utf8_unchecked`.

As noted in the comment, this is probably unnecessary, but it doesn't hurt to add this defensive code while new `Vec` implementation is under development. We can remove it again later when we're satisfied we have covered all bases.
@graphite-app graphite-app bot force-pushed the 03-14-refactor_allocator_vec_add_comment_about_lifetime_bound_on_clonein_for_vec2_vec_ branch from 6409205 to a1a8b93 Compare March 14, 2025 06:44
@graphite-app graphite-app bot force-pushed the 03-14-refactor_allocator_improve_safety_of_string_from_utf8_unchecked_ branch from 9ee94df to d13817e Compare March 14, 2025 06:45
@Dunqing
Copy link
Member

Dunqing commented Mar 14, 2025

You handle "unsafe" with great rigor; I am learning from you by observing closely.

@overlookmotel
Copy link
Member Author

You handle "unsafe" with great rigor; I am learning from you by observing closely.

I am just following the greater minds of the authors of the std lib!

Base automatically changed from 03-14-refactor_allocator_vec_add_comment_about_lifetime_bound_on_clonein_for_vec2_vec_ to main March 14, 2025 06:54
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 14, 2025
@graphite-app graphite-app bot merged commit d13817e into main Mar 14, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 03-14-refactor_allocator_improve_safety_of_string_from_utf8_unchecked_ branch March 14, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants