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

Ensure that all Bigarray memory managed by the GC is tracked by Memprof #3356

Merged

Conversation

stedolan
Copy link
Contributor

There were two cases where this was not already the case:

  • Unix.map_file: Fixed by adding memprof calls to mmap_ba.c

  • User-allocated, GC-freed bigstrings: These are allocated by calls to caml_ba_alloc with CAML_BA_MANAGED, non-NULL data, and not CAML_BA_SUBARRAY (so new bigarrays, not slices)

    Runtime5 already handled this case correctly. The fix for runtime4 is to add a new call to memprof for the missing case.

Copy link
Collaborator

@lpw25 lpw25 left a comment

Choose a reason for hiding this comment

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

LGTM

There were two cases where this was not already the case:

  - Unix.map_file:
    Fixed by adding memprof calls to mmap_ba.c

  - User-allocated, GC-freed bigstrings:
    These are allocated by calls to caml_ba_alloc with CAML_BA_MANAGED,
    non-NULL data, and not CAML_BA_SUBARRAY (so new bigarrays, not slices)

    Runtime5 already handled this case correctly. The fix for runtime4
    is to add a new call to memprof for the missing case.
@stedolan stedolan force-pushed the fix-bigarray-memprof-tracking branch from 99c0ad0 to c87664e Compare December 10, 2024 18:17
@stedolan
Copy link
Contributor Author

The build failure was #3358

@mshinwell mshinwell merged commit 8d31575 into ocaml-flambda:main Dec 11, 2024
19 checks passed
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.

3 participants