Image3D/Field3D swap() function unsafe with Managed[Image/Field]3D

Issue #40 new
Sam Preston created an issue

Before the changes to MemoryManager, an image/field could safely swap() with a managed object. This is no longer the case, as now the underlying memory is owned by the MemoryManager and not the containing Image/Field. This introduced a bug in MultiscaleResampler, which swap()ed memory with managed objects. The overall functionality may stay broken (it's not really surprising that swap()ing with managed object could be unsafe), but it should be looked at to see if there is an easy fix. The difference from previous versions should at least be noted.

Comments (3)

  1. Jacob Hinkle

    This is because we don't want to swap an unmanaged mempool in for a managed one right? This is tricky. I hadn't ever used swap() before. Is there a way to do this within python maybe, where the actual types swap also?

  2. Jacob Hinkle

    Is there a reason we can't do this in python?

    I, J = J, I
    

    I think that just swaps the references right?

  3. Log in to comment