Some know I'm working to improve swig-php to make module generation easy and
satisfying.

The final hurdle remains in handling and generating callbacks from the
module to PHP.  Or rather from the library the module wraps to PHP.

This requires some kind of callback wrapper that can convert from a flat
function pointer the library expects to a complete object-method (or just
function) reference that call_user_function expects.

This problem is solved but it requires some per-callback-function allocation
to hold this extra data.

The new problem is that swig can't tell when the scope of the callback
closes (when no more callbacks will occur) and when it can free this
structure, so for longer lived scripts which make new objects often to
handle callbacks we allocate and do not free ever more and more structures.

If a module could request notification when all/specific objects are
destroyed it would be able to free these structures when the object dies and
thus avoid long term memory leaks.

Are PHP developers willing to provide a mechanism where more than one module
can request notification when objects generally, or specific objects are
destroyed?

Sam




-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to