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

Unable to allocate more than 2 Gb in a single chunk #40

Closed
asl opened this issue Mar 11, 2019 · 3 comments
Closed

Unable to allocate more than 2 Gb in a single chunk #40

asl opened this issue Mar 11, 2019 · 3 comments

Comments

@asl
Copy link

asl commented Mar 11, 2019

void *GlobalHeap::malloc(size_t sz) {

contains the following code effectively preventing large allocation:

if (unlikely(pageCount * kPageSize > INT_MAX)) {
    return nullptr;
 }
@asl
Copy link
Author

asl commented Mar 11, 2019

I have not looked into the code deeper, but simply disabling the check seems to fix the issue.

@bpowers
Copy link
Member

bpowers commented Mar 11, 2019

I seem to have cargo-culted this from Heap-Layer's ansiwrapper. To be on the safe side, I've increased the integer types for some functions from Length (uint32_t) to size_t in the MeshableArena, to avoid inadvertently doing 32-bit math that might have bad consequences here.

Thanks for this!

@bpowers
Copy link
Member

bpowers commented Mar 11, 2019

(commited a fix in 41311fc)

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