Open spectre-ns opened 2 years ago
I think you can use your own allocator as an argument in the template.
@wolfv thanks! I have been able to use the polymorphic_allocator<> to get xtensor working from a pool. Would there be anyway to pass it the resource like std::pmr:vector does so I don't have to set the global resource pointer?
This requires to update the constructors of the xtensor and xarray classes, so they accept an additional argument and forward it to the storage container. This is definitely a PR that we would accept, I can provide some guidance if needed.
@JohanMabille I have another pull request on my queue right now. After I complete that I might work on this. Is QuantStack still adding features to xtensor as well or are their other priorities right now?
Both, xtensor is not funded at this time, so we are maintaining it on our free time, but we still have ideas and a plan for xtensor ;)
@JohanMabille I think making xtensor work with pmr would require C++17.
I would like to use xtensor in a real time computing application and I need to avoid allocations from new and delete while computing the data with all the allocations occurring prior to computation starting. I can use std::pmr to accomplish this is there any way to pin xtensor to this memory object?