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

Maybe missing _base variants in overrides #638

Open
Naville opened this issue Sep 21, 2023 · 2 comments
Open

Maybe missing _base variants in overrides #638

Naville opened this issue Sep 21, 2023 · 2 comments

Comments

@Naville
Copy link
Contributor

Naville commented Sep 21, 2023

Continuing the discussion from #631 since that one is closed....

After applying the patch that also overrides _msize_base, the project compiles. but got greeted with many "Not allocated by this allocator" error.

Running dumpbin /SYMBOLS on the ucrt lib shows there is a _base variant for many other heap related APIs.

I wonder these information that might requires some microsoft internal employee's knowledge:

  • Why these _base variant calls appeared in the final binary when no source code referenced them?
  • Should snmalloc provide overrides for them too?
@Naville
Copy link
Contributor Author

Naville commented Sep 21, 2023

my fork seems to workaround existing issue, though it seems you also need to implement _recalloc and maybe _recalloc_base

CC @mjp41

@mjp41
Copy link
Member

mjp41 commented Sep 21, 2023

The jemalloc compat basically has _recalloc. If you specialise to the flag being set to say it should be zeroed:

https://github.com/Naville/snmalloc/blob/583cd5da55de58fe320a7054ce15d980071ed44c/src/snmalloc/override/jemalloc_compat.cc#L267-L302

Happy to add this overrides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants