Commits (65)
-
Xavier Thompson authoreda4bc6221
-
Xavier Thompson authored904b7eee
-
Xavier Thompson authoredacf56eff
-
Xavier Thompson authored967a395d
-
Xavier Thompson authored
This reverts parts of commit: 'Optimise refcounting when assigning from a temporary cypclass'
b24fad38 -
Xavier Thompson authored11915abb
-
Xavier Thompson authored4484a4d9
-
Xavier Thompson authored43467205
-
Xavier Thompson authored8d153541
-
Xavier Thompson authored44056f33
-
Xavier Thompson authoredf5984db3
-
Xavier Thompson authoreda505e7ef
-
Xavier Thompson authoredd9ca179c
-
Xavier Thompson authoredfb0630cf
-
Xavier Thompson authored8f14ad8c
-
Xavier Thompson authored3d681d3e
-
Xavier Thompson authored0c42e8eb
-
Xavier Thompson authored777eb626
-
Xavier Thompson authoredbeb847ce
-
Xavier Thompson authored28025b43
-
Xavier Thompson authored85049a1a
-
Xavier Thompson authored8cfda3ec
-
Xavier Thompson authoreda66ffc46
-
Xavier Thompson authoreda80ce036
-
Xavier Thompson authored2575a500
-
Xavier Thompson authored6f1f493d
-
Xavier Thompson authoredbe2d17ba
-
Xavier Thompson authorede9fbd755
-
Xavier Thompson authored2b51fc1f
-
Xavier Thompson authoredf7b2cfd1
-
Xavier Thompson authored69d0430d
-
Xavier Thompson authored48a1e3f9
-
Xavier Thompson authored34a5e359
-
Xavier Thompson authored5ea4b23c
-
Xavier Thompson authored3c2d60a1
-
Xavier Thompson authored5fa9a0ba
-
Xavier Thompson authored271464ba
-
Xavier Thompson authoreddb5127ae
-
Xavier Thompson authored0790e362
-
Xavier Thompson authored
This changes the reference counting convention for passing cyobjects as arguments in a function call. Before this commit, cyobjects used the same convention as pyobjects: - The function borrows a reference on the argument from the caller and the caller keeps ownership of the object passed as argument, and must eventually decref it, even if it is a temporary rvalue that will not be reachable in the caller's scope after the call. - If the function needs to take ownership of the argument, e.g. to store it, it must increment its reference count first, at which point the caller and callee both own a reference to the object. - If the callee does not take ownership of the argument, it should not decrement its reference count at any point. After this commit, the convention for cyobjects is as follows: - The function steals the reference on the argument from the caller, and the caller should not decrement its reference count after the call. - If the object will still be reachable in the caller's scope after the call the caller must increment its reference count __before__ the call to retain ownership of its reference after the call. - The function has ownership of the reference received as argument, and must decref it when if goes out of scope. The main reason for this change is to make it possible to 'consume' an argument from within a function. Before this change there was no reliable way to determine from within the function whether the caller would retain a reference on the argument after the call, which is required when the 'consume' operation needs a runtime check. The 'self' argument in a cypclass method is currently still an exception to this change: it still follows the previous convention.
98a93bc2 -
Xavier Thompson authored2fd7bc9f
-
Xavier Thompson authored013eec6b
-
Xavier Thompson authored23778224
-
Xavier Thompson authored7f1cf72d
-
Xavier Thompson authored5c79474f
-
Xavier Thompson authorede1939449
-
Xavier Thompson authoredc329db8f
-
Xavier Thompson authored5d0d221d
-
Xavier Thompson authorede78ace1c
-
Xavier Thompson authored5b10cf01
-
Xavier Thompson authored534ea61f
-
Xavier Thompson authored5e7b7c0d
-
Xavier Thompson authoredafdf8cde
-
Xavier Thompson authored13ee9bf1
-
Xavier Thompson authored30f17717
-
Xavier Thompson authored7677b120
-
Xavier Thompson authored52d40881
-
Xavier Thompson authored5f44fcb1
-
Xavier Thompson authoreda09e8c79
-
Xavier Thompson authoredcbd03841
-
Xavier Thompson authored
This commit introduces the following changes: - 'locked' becomes 'lock' - 'locked&' becomes 'locked' - references reachable from a locked reference are noted as 'lock->'
34924021 -
Xavier Thompson authoredfd3344bd
-
Xavier Thompson authored45f6afe3
-
Xavier Thompson authored41c102b0
-
Xavier Thompson authored608c29a9
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.