ariovistus / pyd

Interoperability between Python and D
MIT License
158 stars 32 forks source link

placement new no longer works for D #116

Closed burner closed 5 years ago

burner commented 5 years ago

So the current way of working with allocators does no longer work. This PR pulls out the placement new's and delete's and the allocators.

ariovistus commented 5 years ago

don't remember the specifics, but I think removing malloc allocation from references.d is going to have some implications. Let's see here, for every D object that is wrapped and used in python, a reference to it is stored in Container, as is a reference to the python object. this prevents D from garbage collecting something python still has a reference to, and possibly vice versa. I don't think Container is malloc allocated to avoid gc references to objects exposed to D, that doesn't make sense to me. looking at https://github.com/ariovistus/pyd/blob/master/infrastructure/pyd/class_wrap.d#L95, it might be some similar fiddly implementation issue.

burner commented 5 years ago

how do you suggest we get pyd compiling with 2.087 then?

ariovistus commented 5 years ago

well, if it was an implementation issue, it was 6 years ago. might not be an issue any more. guess we can try it and see what happens.

burner commented 5 years ago

sounds like a plan, thanks.

Could we also get a new release

ariovistus commented 5 years ago

ya, we're a bit overdue for one of those

ariovistus commented 5 years ago

0.11.0 should be up now, let me know if it isn't somewhere

burner commented 5 years ago

looks good so far, I'll let you know if there is something else.

Thanks

John-Colvin commented 5 years ago

@ariovistus I think your fears were justified, I am seeing strange segfaults since this change. See https://github.com/ariovistus/pyd/pull/119 for an alternative