Closed hazen closed 10 years ago
the changes seem reasonable, but I'm going to have to give it another read later
this PR seems fine, it might be nice to have more info regarding the managed
flag. I suppose that's a documentation issue for later.
+1
This struct and its supporting functions developed organically over the creation of the API. It had two flavors: deep and shallow copies. The naming was inconsistent and because sometimes pointers did not point to memory which it owned, the user had to be careful which version to call to free memory.
This refactor makes the interface much simpler and the data is copied by default. I found though the refactoring exercise that there are places where a shallow-copied binary is probably more efficient. A
managed
flag was added along the way, too, to determine who should free the payload.