Skip to content

Add AllocationTrackedMemoryManager and refactor allocators#3120

Open
JimBobSquarePants wants to merge 3 commits intomainfrom
js/optimize-allocation-tracking
Open

Add AllocationTrackedMemoryManager and refactor allocators#3120
JimBobSquarePants wants to merge 3 commits intomainfrom
js/optimize-allocation-tracking

Conversation

@JimBobSquarePants
Copy link
Copy Markdown
Member

@JimBobSquarePants JimBobSquarePants commented Apr 19, 2026

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

An updated implementation of #3056

@antonfirsov your comment in the PR was the key to a better implementation for me.

it might make sense to tweak public API-s to solve this properly

I was so determined not to make a breaking change that I massively overcomplicated the implementation and made it inefficient.

This PR changes things by implementing a new type AllocationTrackedMemoryManager which custom allocator memory managers must implement. By making MemoryAllocator.Allocate non virtual and adding an abstract AllocateCore I can introduce tracking without the allocation and complexity cost.

@JimBobSquarePants JimBobSquarePants added breaking Signifies a binary breaking change. area:allocators labels Apr 19, 2026
@antonfirsov
Copy link
Copy Markdown
Member

antonfirsov commented Apr 20, 2026

It would be very helpful for my review if we could revert #3056, and rebase this on top of the original state. I want to review the feature implementation as a whole thing and now it's difficult to react to specific changes from that PR.

@JimBobSquarePants JimBobSquarePants force-pushed the js/optimize-allocation-tracking branch from 127b5bb to 15fd941 Compare April 22, 2026 12:46
@JimBobSquarePants
Copy link
Copy Markdown
Member Author

@antonfirsov

#3056 has been reverted and this PR rebased over the top. Hopefully this is much easier to review now the diff is clean.

@antonfirsov
Copy link
Copy Markdown
Member

Thanks a lot! I'll come back to this once the Drawing API is concluded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:allocators breaking Signifies a binary breaking change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants