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:
parent
597f650d02
commit
0b36bc6940
1 changed files with 3 additions and 4 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue