Fix lots of bad stuff going on. #1

Merged
jevolk merged 3 commits from main into main 2024-10-23 19:18:59 +00:00
jevolk commented 2024-10-23 12:41:31 +00:00 (Migrated from github.com)

This is the first issue:
Screenshot from 2024-10-23 04-47-13

There were two if not three additional issues behind that. This seems like it stems from lack of argument hygiene while playing fast and loose with the different jemalloc API surfaces, mixing and matching different codepaths and options for alloc, realloc and freeing lifecycles. This is all really subtle ugly C/posix kind of stuff between the lines of the documentation that people thumb their nose at while evangelizing Rust.

Nevertheless now there are no issues. This is because we:

  • Enforce the platform quantums for allocation sizes and alignments that make a minimum of sense rather than throwing everything at different parts of jemalloc and hoping for the best.
  • Reducing the amount of API used itself and purposely limiting that to one matching family of functions. This hedges against subtle misuses and bugs, maybe some that aren't even our fault. It also eliminates a difficult branch in a rather hot codepath.
This is the first issue: ![Screenshot from 2024-10-23 04-47-13](https://github.com/user-attachments/assets/43bea13a-52ff-4bbf-839c-8f8d2ba82663) There were two if not three additional issues behind that. This seems like it stems from lack of argument hygiene while playing fast and loose with the different jemalloc API surfaces, mixing and matching different codepaths and options for alloc, realloc and freeing lifecycles. This is all really subtle ugly C/posix kind of stuff between the lines of the documentation that people thumb their nose at while evangelizing Rust. Nevertheless now there are no issues. This is because we: - Enforce the platform quantums for allocation sizes and alignments that make a minimum of sense rather than throwing everything at different parts of jemalloc and hoping for the best. - Reducing the amount of API used itself and purposely limiting that to one matching family of functions. This hedges against subtle misuses and bugs, maybe some that aren't even our fault. It also eliminates a difficult branch in a rather hot codepath.
Sign in to join this conversation.
No description provided.