示例#1
0
void CacheClose( file_list *list, unsigned pass )
/******************************************************/
{
    infilelist *file;
    bool        nukecache;

    if( list == NULL )
        return;
    file = list->file;
//    if( file->handle == NIL_FHANDLE ) return;
    file->flags &= ~INSTAT_IN_USE;
    switch( pass ) {
    case 1: /* first pass */
        nukecache = !(file->flags & INSTAT_LIBRARY);
        if( file->flags & INSTAT_FULL_CACHE ) {
            if( nukecache ) {
                FreeObjCache( list );
            }
        } else {
            DumpFileCache( file, nukecache );   // don't cache .obj's
        }
        break;
    case 3: /* freeing structure */
        FreeObjCache( list );
        if( file->handle != NIL_FHANDLE ) {
            QClose( file->handle, file->name );
            file->handle = NIL_FHANDLE;
        }
        break;
    }
}
示例#2
0
文件: mixcache.c 项目: JWasm/JWlink
void FreeObjCache( file_list *list )
/*****************************************/
{
    if( list == NULL ) return;
    if( list->file->flags & INSTAT_FULL_CACHE ) {
        _LnkFree( list->file->cache );
    } else {
        DumpFileCache( list->file, TRUE );
    }
    list->file->cache = NULL;
}
示例#3
0
bool DumpObjCache( void )
/******************************/
// find and dump an object file cache.
{
    infilelist *file;

    for( file = CachedFiles; file != NULL; file = file->next ) {
        if( file->flags & INSTAT_PAGE_CACHE ) {
            if( CurrMod == NULL || CurrMod->f.source == NULL
                                || CurrMod->f.source->file != file ) {
                if( DumpFileCache( file, TRUE ) ) {
                    return( TRUE );
                }
            }
        }
    }
    return( FALSE );
}