c123796949
Previously memory that was allocated outside of VTK-m was impossible to transfer to VTK-m as we didn't know how to free it. By extending the ArrayHandle constructors to support a Storage object that is being moved, we can clearly express that the ArrayHandle now owns memory it didn't allocate. Here is an example of how this is done: ```cpp T* buffer = new T[100]; auto user_free_function = [](void* ptr) { delete[] static_cast<T*>(ptr); }; vtkm::cont::internal::Storage<T, vtkm::cont::StorageTagBasic> storage(buffer, 100, user_free_function); vtkm::cont::ArrayHandle<T> arrayHandle(std::move(storage)); ``` |
||
---|---|---|
.. | ||
testing | ||
ArrayExportMacros.h | ||
ArrayHandleBasicImpl.cxx | ||
ArrayHandleBasicImpl.h | ||
ArrayHandleBasicImpl.hxx | ||
ArrayHandleExecutionManager.h | ||
ArrayManagerExecution.h | ||
ArrayManagerExecutionShareWithControl.cxx | ||
ArrayManagerExecutionShareWithControl.h | ||
ArrayPortalFromIterators.h | ||
ArrayPortalShrink.h | ||
ArrayTransfer.h | ||
CMakeLists.txt | ||
ConnectivityExplicitInternals.h | ||
DeviceAdapterAlgorithmGeneral.h | ||
DeviceAdapterDefaultSelection.h | ||
DeviceAdapterError.h | ||
DeviceAdapterListHelpers.h | ||
DeviceAdapterTag.h | ||
DynamicTransform.h | ||
FunctorsGeneral.h | ||
IteratorFromArrayPortal.h | ||
SimplePolymorphicContainer.cxx | ||
SimplePolymorphicContainer.h | ||
StorageError.h | ||
VirtualObjectTransfer.h | ||
VirtualObjectTransferShareWithControl.h |