phobos icon indicating copy to clipboard operation
phobos copied to clipboard

Add GCHeapMallocator

Open pbackus opened this issue 3 years ago • 7 comments

In preparation for the removal of GCAllocator.deallocate and GCAllocator.reallocate, make that functionality available via a new allocator with a different name.

Users of GCAllocator that wish to continue using manual @system memory management instead of automatic @safe memory management can switch to GCHeapMallocator.

For the rationale behind these changes, see PR #8554 and issue 23318.


CC @CyberShadow @schveiguy

@atilaneves this adds a new symbol

pbackus avatar Sep 03 '22 21:09 pbackus

Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
23318 enhancement GCAllocator should not implement deallocate

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#8555"

dlang-bot avatar Sep 03 '22 21:09 dlang-bot

core.exception.AssertError@std/logger/core.d(1905): foo

Looks like a flaky test. Force pushing to retry...

pbackus avatar Sep 03 '22 22:09 pbackus

https://github.com/dlang/phobos/pull/8557

burner avatar Sep 04 '22 18:09 burner

Rebased to pick up #8557

pbackus avatar Sep 04 '22 23:09 pbackus

Can this be an alias/wrapper underneath? Hard to review this when most likely it's simply a copy-paste of existing code.

schveiguy avatar Sep 05 '22 19:09 schveiguy

@schveiguy Made it a wrapper.

pbackus avatar Sep 05 '22 19:09 pbackus

Please see my comments on the other PR.

atilaneves avatar Sep 09 '22 13:09 atilaneves