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

heavy revision on heap_breakdown's safety #12445

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

paperdave
Copy link
Collaborator

What does this PR do?

I wish we had some internal docs on heap breakdown. It is very cool. This PR makes it more safe for us to use.

Rename bun.HeapBreakdown to bun.heap_breakdown. Rename bun.is_heap_breakdown_enabled to bun.heap_breakdown.enabled.

To use the heap breakdown allocator functions directly, recommend using heap_breakdown.getZone(T).create(T, t). But it is better to simply use the bun.New mixin, which opts you into heap breakdown automatically.

Refactors the following: bun.new, bun.destroy, bun.create, bun.New, bun.NewRefCounted. They are much easier to read now.

Main motivation for this is to introduce a new assertion which ensures types that forcefully opt into heap breakdown (From bun.New) are impossible to create via standard library allocators.

image

@paperdave
Copy link
Collaborator Author

re: rename HeapBreakdown -> heap_breakdown

I want to slowly move parts of our codebase into proper casing.

Copy link
Contributor

github-actions bot commented Jul 9, 2024

@paperdave, your commit has failing tests :(

🪟💻 2 failing tests Windows x64 baseline

  • test/cli/install/registry/bun-install-registry.test.ts 2 failing
  • test/js/node/child_process/child_process.test.ts 1 failing

🪟💻 2 failing tests Windows x64

  • test/cli/install/registry/bun-install-registry.test.ts 1 failing
  • test/js/node/child_process/child_process.test.ts 1 failing

View logs

@Jarred-Sumner Jarred-Sumner merged commit 5137213 into main Jul 9, 2024
50 of 53 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dave/heap-breakdown-revisions branch July 9, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants