Made check in rubyclasses a little bit safer

to exit early on ints, nil, false, true, symbols,
internal nodes and none.



git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9825 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-05-19 09:41:23 +00:00
commit 7c2e64a8dd

View file

@ -165,13 +165,17 @@ namespace swig {
void GC_register()
{
if ( TYPE(_obj) != T_DATA ) return;
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 ( TYPE(_obj) != T_DATA ) return;
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_delete( _hash, _obj );
}