示例#1
0
_WCRTLINK int _fheapchk( void )
{
    struct _heapinfo    hi;
    int                 heap_status;
    unsigned long       free_size;

    _AccessFHeap();
    heap_status = checkFreeList( &free_size );
    if( heap_status != _HEAPOK ) {
        _ReleaseFHeap();
        return( heap_status );
    }
    hi._pentry = NULL;
    while( (heap_status = __HeapWalk( &hi, __fheapbeg, _NULLSEG )) == _HEAPOK ) {
        if( hi._useflag == _FREEENTRY ) {
            heap_status = checkFree( hi._pentry );
            if( heap_status != _HEAPOK )
                break;
            free_size -= hi._size;
        }
    }
    if( free_size != 0 ) {
        heap_status = _HEAPBADNODE;
    } else if( heap_status == _HEAPBADPTR ) {
        heap_status = _HEAPBADNODE;
    } else if( heap_status == _HEAPEND ) {
        heap_status = _HEAPOK;
    }
    _ReleaseFHeap();
    return( heap_status );
}
示例#2
0
_WCRTLINK int _fheapwalk( struct _heapinfo *entry )
    {
        int     heap_status;

        _AccessFHeap();
        heap_status = __HeapWalk( entry, __fheap, 0 );
        _ReleaseFHeap();
        return( heap_status );
    }
示例#3
0
_WCRTLINK int _bheapwalk( __segment seg, struct _heapinfo *entry )
{
    int     heap_status;

    if( seg == _DGroup() ) return( _nheapwalk( entry ) );
    _AccessFHeap();
    heap_status = __HeapWalk( entry, seg == _NULLSEG ? __bheap : seg, seg );
    _ReleaseFHeap();
    return( heap_status );
}