snmalloc icon indicating copy to clipboard operation
snmalloc copied to clipboard

override add OpenBSD's malloc_conceal API proposal.

Open devnexen opened this issue 4 years ago • 3 comments

first step: templatization of PALs, type not triggered yet.

devnexen avatar Dec 05 '21 08:12 devnexen

Apologies, I broke CI with the branch name change, can you rebase onto the latest main to get the checks to run.

Sorry, I haven't commented on this yet, I try to get to it soon.

mjp41 avatar Dec 13 '21 15:12 mjp41

Thanks for looking into this.

So here are some high-level points

  • I like having a completely distinct allocator for the concealed version.
  • I am not happy with the threading of template parameters. There seem to have affected more than I would expect.
  • There are two different pagemaps covering the whole address range as their are two different instances of BackendAllocator. Each will have it's own pagemap. I think a more complex structure is required here to allow more sharing. The pagemap is a massive reservation, and having two seems bad.
  • I think that perhaps ThreadAlloc should be templated to carry the underlying Alloc it is providing.
  • I am not happy to pass around a specific configuration feature to a Pal. I think we should have a different Pal as the template parameter. So you instantiate the backend with PalLinux<DoDump> rather than having a backend parameterised by a feature.

Some questions:

  • Do you want free to work on something returned by malloc_conceal?
  • Do malloc_conceal and malloc need to be in the same compilation unit?

Sorry, I haven't got much time until the new year to help you with this.

mjp41 avatar Dec 15 '21 15:12 mjp41

Some questions:

  • Do you want free to work on something returned by malloc_conceal?

Yes, the openbsd libc version allows it too thankfully, freezero just do an extra step, that s it.

  • Do malloc_conceal and malloc need to be in the same compilation unit?

Does not have to.

Sorry, I haven't got much time until the new year to help you with this.

I m not in a hurry myself no worries :-)

devnexen avatar Dec 15 '21 16:12 devnexen