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:
parent
1cf8d3dd36
commit
7c2e64a8dd
1 changed files with 6 additions and 2 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue