GameMonkey Script

GameMonkey Script Forums
It is currently Wed Jan 23, 2019 1:29 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Feb 21, 2004 4:54 am 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 708
Occasionally, in incremental garbage collection mode there was a crash, particularly in release mode. It was caused by the gmTable running the write barrier on deleted value objects. The gmTable nullifies the key object but the GC code was ignoring this logic.

To fix, the following code

Code:
#if GM_USE_INCGC
    if(origHashNode->m_key.IsReference())
    {
      a_machine->GetGC()->WriteBarrier((gmObject*)origHashNode->m_key.m_value.m_ref);
    }
    if(origHashNode->m_value.IsReference())
    {
      a_machine->GetGC()->WriteBarrier((gmObject*)origHashNode->m_value.m_value.m_ref);
    }
#endif //GM_USE_INCGC


which is already in gmTableObject.cpp below line 138 must be moved
INTO the block above it like this:

Code:
  if(origHashNode->m_key.m_type != GM_NULL) //Main pos is not free
  {
      ... other code here...

       MOVED TO HERE
  }
 
  MOVED FROM HERE

  // Fill new value
  origHashNode->m_key = a_key;
  origHashNode->m_value = a_value;



v1.2 is in the making and may be released soon to patch the last two bugs. I still havn't finished the 'game object' example that was supposed to go with it so I might leave that out until the next version.

I was very pleased to find this bug as it had been reported by a company using GM but I was unable to reproduce it. During the Inc GC improvements I had been planning for a long time it surfaced. I now have some serious paranoid checking code enableable to make sure the system is rock solid.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group