Removed & test and changed it for a simpler T_NONE

test.  This seems to avoid issues and is slightly
faster.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9827 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-05-19 16:51:39 +00:00
commit 0b36bc6940

View file

@ -166,16 +166,15 @@ namespace swig {
void GC_register()
{
if ( FIXNUM_P(_obj) || SPECIAL_CONST_P(_obj) || SYMBOL_P(_obj) ) return;
short t = BUILTIN_TYPE(_obj);
if ( !t || (t & 0x30 == 0x30) ) return;
rb_hash_aset( _hash, _obj, Qtrue );
}
void GC_unregister()
{
if ( FIXNUM_P(_obj) || SPECIAL_CONST_P(_obj) || SYMBOL_P(_obj) ) return;
short t = BUILTIN_TYPE(_obj);
if ( !t || (t & 0x30 == 0x30) ) return;
// this test should not be needed but I've noticed some very erratic
// behavior of none being unregistered in some very rare situations.
if ( BUILTIN_TYPE(_obj) == T_NONE ) return;
rb_hash_delete( _hash, _obj );
}