From 80cfb889c3c0a38ffe98bd789fd03ac9d8752087 Mon Sep 17 00:00:00 2001 From: Yichao Yu <yyc1992@gmail.com> Date: Fri, 20 Jun 2014 14:28:20 +0800 Subject: [PATCH] update doc of python callbacks --- pyopencl/_cffi.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyopencl/_cffi.py b/pyopencl/_cffi.py index 60cb2e69..47c0318e 100644 --- a/pyopencl/_cffi.py +++ b/pyopencl/_cffi.py @@ -187,10 +187,9 @@ def _py_deref(handle): except: pass -# TODO: -# Not sure if cffi always return the same address for the same object -# Unless it is, this function might return a different pointer from its input -# and should only be called once. +# return a new reference of the object pointed to by the handle. +# The return value might be different with the input (on PyPy). +# _py_deref should be called (once) when the object is not needed anymore. @_ffi.callback('void*(void*)') def _py_ref(handle): obj = _ffi.from_handle(handle) -- GitLab