Changeset 368


Ignore:
Timestamp:
Nov 3, 2007, 3:37:02 AM (17 years ago)
Author:
dai
Message:

GCのマーク時間を短縮した

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/system/gc.sbp

    r364 r368  
    346346
    347347    /*!
    348     @brief  スウィープする
    349     @author Daisuke Yamamoto
    350     @date   2007/10/21
    351     */
    352     Sub sweep()
     348    @brief  必要であればスウィープする
     349    @author Daisuke Yamamoto
     350    @date   2007/10/21
     351    */
     352    Sub TrySweep()
    353353        If isSweeping <> False or (iAllSize<limitMemorySize and countOfMemoryObjects<limitMemoryObjectNum) Then
    354354            'メモリ使用量が上限値を超えていないとき
     
    356356        End If
    357357
     358        Sweep()
     359    End Sub
     360
     361    /*!
     362    @brief  スウィープする
     363    @author Daisuke Yamamoto
     364    @date   2007/10/21
     365    */
     366    Sub Sweep()
    358367        Dim hThread As HANDLE
    359368        Dim ThreadId As DWord
     
    377386    */
    378387    Function HitTest(pSample As VoidPtr) As Long
     388        If pSample = NULL Then
     389            Return -1
     390        End If
     391
    379392        Dim i As Long
    380393        For i=0 To ELM(countOfMemoryObjects)
     
    606619
    607620
    608         If isSweeping <> False or (iAllSize<limitMemorySize and countOfMemoryObjects<limitMemoryObjectNum) Then
    609             ExitThread(0)
    610         End If
     621        'If isSweeping <> False or (iAllSize<limitMemorySize and countOfMemoryObjects<limitMemoryObjectNum) Then
     622        '   ExitThread(0)
     623        'End If
    611624        isSweeping = True
    612625
     
    710723Function GC_malloc(size As Long) As VoidPtr
    711724    ' sweep
    712     _System_pGC->sweep()
     725    _System_pGC->TrySweep()
    713726
    714727    'allocate
     
    718731Function GC_malloc_atomic(size As Long) As VoidPtr
    719732    ' sweep
    720     _System_pGC->sweep()
     733    _System_pGC->TrySweep()
    721734
    722735    'allocate
     
    726739Function _System_GC_malloc_ForObject(size As Long) As VoidPtr
    727740    ' sweep
    728     _System_pGC->sweep()
     741    _System_pGC->TrySweep()
    729742
    730743    'allocate
     
    734747Function _System_GC_malloc_ForObjectPtr(size As Long) As VoidPtr
    735748    ' sweep
    736     _System_pGC->sweep()
     749    _System_pGC->TrySweep()
    737750
    738751    'allocate
Note: See TracChangeset for help on using the changeset viewer.