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

interval trees: use stdx.allocator / configurable memory alloc strategy #7

Open
jblachly opened this issue Mar 19, 2019 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@jblachly
Copy link
Member

No description provided.

@jblachly jblachly added the enhancement New feature or request label Mar 19, 2019
@jblachly
Copy link
Member Author

@jblachly jblachly reopened this Nov 11, 2019
@jblachly
Copy link
Member Author

Actually need to work on this in chainfile.

Currently, ChainFile is responsible for allocating the links placed in the Tree. When using AllocatorList!Region!Mallocator, the memory is allocated fine, but when ChainFile goes out of scope the memory is freed, leading to bad accesses in IITree. AVL and SPlay trees seem not affected I think because their insert methods use GC.

I fixed this temporarily by moving back to a manual malloc pool allocator (which never frees since the pool is part of ChainFile and we need it 'til the end of program essentially), but I would like to transition back to std.experimental.allocator in the future.

Probably the correct wayt o do this is to use the thread global theAllocator
https://dlang.org/phobos/std_experimental_allocator.html

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

No branches or pull requests

1 participant