{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/8303","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/8303/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/8303/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/8303/events","html_url":"https://github.com/numpy/numpy/pull/8303","id":191323210,"number":8303,"title":"ENH: add cyclic GC support to object arrays. Closes #6581.","user":{"login":"J-Sand","id":23218231,"avatar_url":"https://avatars1.githubusercontent.com/u/23218231?v=3","gravatar_id":"","url":"https://api.github.com/users/J-Sand","html_url":"https://github.com/J-Sand","followers_url":"https://api.github.com/users/J-Sand/followers","following_url":"https://api.github.com/users/J-Sand/following{/other_user}","gists_url":"https://api.github.com/users/J-Sand/gists{/gist_id}","starred_url":"https://api.github.com/users/J-Sand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/J-Sand/subscriptions","organizations_url":"https://api.github.com/users/J-Sand/orgs","repos_url":"https://api.github.com/users/J-Sand/repos","events_url":"https://api.github.com/users/J-Sand/events{/privacy}","received_events_url":"https://api.github.com/users/J-Sand/received_events","type":"User","site_admin":false},"labels":[{"id":6359239,"url":"https://api.github.com/repos/numpy/numpy/labels/09%20-%20Enhancement","name":"09 - Enhancement","color":"fef2c0","default":false},{"id":16917029,"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.core","name":"component: numpy.core","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-23T16:38:53Z","updated_at":"2017-04-11T09:57:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/8303","html_url":"https://github.com/numpy/numpy/pull/8303","diff_url":"https://github.com/numpy/numpy/pull/8303.diff","patch_url":"https://github.com/numpy/numpy/pull/8303.patch"},"body":"There are a few things I'm uncertain about here:\r\n\r\n- Currently `ndarray` has custom `tp_alloc` and `tp_free` functions, but they don't seem to do anything different to the defaults. Combining cyclic garbage support with custom `tp_alloc` and `tp_free` functions is apparently difficult and I couldn't get it to work, so I just got rid of them. Is that acceptable? It doesn't cause any harm as far as I can tell.\r\n\r\n- I don't really understand `UPDATEIFCOPY`. With the more normal use of `base`, the appropriate thing to do is to visit it in `array_traverse` (because `base` can participate in reference cycles) but ignore it in `array_clear` (because you can't have a reference cycle purely consisting of `base`s, AFAIK). I have a feeling we might need to do something special for arrays with `UPDATEIFCOPY` set.\r\n\r\n- the `array_traverse` code is largely copied from `PyArray_INCREF`, and I included the code that deals with discontiguous and misaligned arrays. However, `PyArray_INCREF` and friends need to support arrays that don't own their own data, but `array_traverse` (or at least this section of it) doesn't. Is it possible to have a discontiguous or misaligned object array (or array with object fields) that owns its data? If not, `array_traverse` can be simplified quite a bit.\r\n\r\n- there are couple of places in `array_dealloc` where the array's refcount is incremented to prevent numpy API calls from triggering `array_dealloc` again (which would be catastrophic). This is harmless, but it makes it difficult to debug GC stuff, because it makes the total refcount go up every time an object array (or an array with `UPDATEIFCOPY` set) is created and then collected. Is there a straightforward way of avoiding this? I can't think of anything."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/293210007","html_url":"https://github.com/numpy/numpy/pull/8303#issuecomment-293210007","issue_url":"https://api.github.com/repos/numpy/numpy/issues/8303","id":293210007,"user":{"login":"homu","id":10212162,"avatar_url":"https://avatars2.githubusercontent.com/u/10212162?v=3","gravatar_id":"","url":"https://api.github.com/users/homu","html_url":"https://github.com/homu","followers_url":"https://api.github.com/users/homu/followers","following_url":"https://api.github.com/users/homu/following{/other_user}","gists_url":"https://api.github.com/users/homu/gists{/gist_id}","starred_url":"https://api.github.com/users/homu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homu/subscriptions","organizations_url":"https://api.github.com/users/homu/orgs","repos_url":"https://api.github.com/users/homu/repos","events_url":"https://api.github.com/users/homu/events{/privacy}","received_events_url":"https://api.github.com/users/homu/received_events","type":"User","site_admin":false},"created_at":"2017-04-11T09:57:24Z","updated_at":"2017-04-11T09:57:24Z","body":":umbrella: The latest upstream changes (presumably #8903) made this pull request unmergeable. Please resolve the merge conflicts."}}
{"actor":{"display_login":"homu"}}