-
Notifications
You must be signed in to change notification settings - Fork 286
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
use custom allocators #28
Comments
One thing I guess to worry about is the long vector support:
because then there is:
so if we saved to a binary file from a version of R that has long vector support and load from a version that does not have it, this might cause issues. |
In general, anything you do is specific to that build of R and platform. But, yes, it essentially gives you the freedom to use arbitrary ways of obtaining memory for specific vector allocations. It's entirely up to you how you obtain the memory that you pass to R. |
@romainfrancois I've just pushed a big update that I think obviates the need for this. The parser now makes very very few copies. |
Suppose we have a binary file of some sort where each vector of the data frame are contiguous. I'm pretty sure we could leverage R custom allocators (wch/r-source@ebf11b0)
So we would need to come up with a
custom_alloc_t
function that would return the appropriate location in the binary mmaped file rather than allocate.Perhaps we can maintain a count of the vectors that are coming from this mmaped file and then unmap when
mem_free
is used on the last of them.@s-u does that sound like a potential use case for this feature ? It seems that with this we could load data pretty instantly (just a bit more than cost of mmap I guess).
The text was updated successfully, but these errors were encountered: