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

Can I use one OakMapBuilder to create more than one OakMap? #194

Closed
fujian-zfj opened this issue Dec 27, 2021 · 1 comment · Fixed by #196
Closed

Can I use one OakMapBuilder to create more than one OakMap? #194

fujian-zfj opened this issue Dec 27, 2021 · 1 comment · Fixed by #196

Comments

@fujian-zfj
Copy link

fujian-zfj commented Dec 27, 2021

    OakMapBuilder<Long, AckData> oakMapBuilder = new OakMapBuilder<>(new OakLongComparator(),
        new OakLongSerializer(), new OakAckDataSerializer(), Long.MIN_VALUE).setMemoryCapacity(MEBIBYTE);
    for (int i = 0; i < 1000; i ++) {
        OakMap<Long, AckData> oakMap = oakMapBuilder.buildOrderedMap();
    }

image

And If I use one OakMapBuilder to create more than one OakMap in multi-threaded process, NativeMemoryAllocator will be Instantiated multiple times.

@liran-funaro
Copy link
Contributor

Thanks for finding this issue. PR #196 addresses this issue.

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

Successfully merging a pull request may close this issue.

2 participants