Skip to content

Compiler hooks can access allocations found by check allocations #858

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

Closed
wants to merge 5 commits into from

Conversation

poechsel
Copy link
Contributor

@poechsel poechsel commented Oct 4, 2022

This PR adds a new compiler hook to fetch all allocations discovered by the check allocations tool.
An allocation is considered to be:

  • A call to caml_alloc
  • A direct call that might allocate
  • An indirect call
  • A caml primitive (caml_apply_, checkbound)
  • An arch specific operation

Each allocation is recorded with it's kind (see the list above), as well as some context (was it post-dominated by a raise? Did it occur from the "catch" part of a try with?). The type for context is here but not implemented as this will be done in a later PR.

Collection of all allocations is done when Checkmach.keep_all_details is set by true by the user. By default it is turned to off and can only be turned off by a program using the compilerlibs or when compiler hook on Check_allocations has been registered.

Copy link
Contributor

@xclerc xclerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of small/ignorable comments,
the only interesting one is the one
about the cmx file I think.

@poechsel poechsel force-pushed the checks-compiler-hooks-details branch from 051ca48 to 32ebc02 Compare October 25, 2022 18:58
@mshinwell
Copy link
Collaborator

@poechsel could you please rebase?

@mshinwell
Copy link
Collaborator

@poechsel ping

@mshinwell
Copy link
Collaborator

This work has been merged via another PR.

@mshinwell mshinwell closed this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants