Ticket #300 (new task)
Opened 4 years ago
Buffers: Acquire through coercion
| Reported by: | dagss | Owned by: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | wishlist |
| Component: | Code Generation | Keywords: | kurtgsoc |
| Cc: |
Description
Currently, buffers are acquired/released through somewhat of a hack: There's code in NameNode to "manually" track assignments to buffered-type local variables and do the right thing when they are reassigned.
This means that it is not possible to do e.g.
print (<object[int]>myobj)[3]
as there wouldn't be a local variable for the buffer.
The proper way of doing this is moving buffer acquisition and release over to the existing Cython coercion system (which is used for coercing C ints to Python ints and so on), and insert a CoercionNode? in situations like above.
This requires #299 to be done first, as a coercion node requires a temporary result, neatly packed in a single variable.
When #177 is done, this will also be what enables
some_cdef_func(python_object)
i.e. without explicitly acquiring the buffer.
