Lisandro Dalcin wrote:
> Dag, I know that the original idea of the dlopen() with RTLD_GLOBAL
> was mine, but you know... I'm so idiot sometimes... This is going to
> be a REAL pain to make it work, specially if you want to make this
> easily portable to the many platforms out there.... For example, Do
> the current implementation work on Windows?

I have no idea. I know next to nothing about Windows development (which 
goes beyond pre-2000-era Delphi GUI programming). And it would be a real 
pain for me to find or set up a Windows workstation with enough tools to 
find out.

> Would you agree to completelly change the way the refnany helper
> routines are imported?. I'm thinking on a ad-hoc way of doing that,
> similar but simpler to the way Cython extension modules can export API
> functions.
> 
> The only requisite would be that the 'refnanny.so' extension module
> can be imported. Then, when you build Cython extensions with
> CYTHON_REFNANNY defined, some special code in the module init function
> imports the 'refnanny' module and get the pointer to a struct having
> pointers to the various routines... No more need to dlopen() or even
> import refnanny in order to enable it....

This sounds like the way Cython implements "api", one could build on 
that. (But writing something dedicated in C might be just as well, 
because all the other things can potentially be subject to refnannying).

The reasons I've done what I've done is mostly to get something as quick 
as possible. If what I've done can't work in Windows, I'd be happy to 
accept a patch along the lines you suggest, but it is pretty far down on 
my own list. (It would mean an extra pointer lookup per refcount call I 
think, but speed is not an issue here...)

An alternative is to write runtests.py to disable the refnanny on 
Windows. As long as it is run on Unix prior to a Cython release it 
should work.


-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to