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

Fix issue #71 #72

Merged
merged 2 commits into from
Jan 30, 2021
Merged

Fix issue #71 #72

merged 2 commits into from
Jan 30, 2021

Conversation

hpwxf
Copy link
Collaborator

@hpwxf hpwxf commented Jan 29, 2021

For windows, allocator/deallocator must be in the same module (cf blog post)
Thus, Numpy arrays cannot be allocator by numpy and deallocated by armadillo.
To fix that, steal_copy_array has been rewritten to be able to build numpy arrays using data allocated by armadillo.
This behavior is set using allow_foreign_allocator variable in steal_copy_array.

Unfortunately, VS 16 (2019) seems to not enable NRVO inside p_arr_to_cube function. This implies Cube object copy (including internal data) when strict is true. That's why, two tests have been disabled on WIN32 in test_arr_to_mat_native.cpp.

@RUrlus
Copy link
Owner

RUrlus commented Jan 30, 2021

Thanks for finding and solving the bugs, much appreciated.

@hpwxf
Copy link
Collaborator Author

hpwxf commented Jan 30, 2021

Thanks for finding and solving the bugs, much appreciated.

It wasn't exactly a "pleasure" and it was somewhat delicate and interesting. I appreciated a lot 😉

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 this pull request may close these issues.

2 participants