-
Notifications
You must be signed in to change notification settings - Fork 2
Add WriteBarrier to dictobject #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This implements the addreference and remove reference logic for the dictionary.
xFrednet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two hight level comments
|
@mjp41 Is this PR still draft or is that a stale label? |
Yes. There is a test failing I fixed locally, but need to tidy the change. |
xFrednet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, mostly superficial comments and questions
|
Is it okay to merge this? |
TobiasWrigstad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @mjp41 !
| bool _Pyrona_AddReference(PyObject* target, PyObject* new_ref); | ||
| #define Pyrona_ADDREFERENCE(a, b) _Pyrona_AddReference(a, b) | ||
| #define Pyrona_REMOVEREFERENCE(a, b) // TODO | ||
| bool _Py_RegionAddReference(PyObject* src, PyObject* new_tgt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the renaming! 🙏
| uint64_t new_version = _PyDict_NotifyEvent( | ||
| interp, PyDict_EVENT_CLONED, mp, b, NULL); | ||
| PyDictKeysObject *keys = clone_combined_dict_keys(other); | ||
| PyDictKeysObject *keys = clone_combined_dict_keys(other, a); // Need to say what owns the keys? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ? at the end of this comment suggests we need a FIXME or TODO label added!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one the comment is stale, and needs removing. a owns the keys.
| // The keys PyDictKeysObject, might already have the key. Note that | ||
| // the keys PyDictKeysObject is not a PyObject. So it is unclear where | ||
| // this edge is created. | ||
| // The keys is coming from ht_cached_keys on the type object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // The keys is coming from ht_cached_keys on the type object. | |
| // The key is coming from ht_cached_keys on the type object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually meant the plural, as it is the "keys object/structure". But I can see why it is confusing and the addition of object/structure would make it clearer.
| return -1; | ||
| } | ||
|
|
||
| //TODO: PYRONA: The addition of the key is complex here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with the labelling. We should go through all our phase3 code and make sure our TODOs and FIXMEs are all labelled thus.
|
Yes, please go ahead! |
This implements the addreference and remove reference logic for the dictionary.