Beispiel #1
0
void CgInfoLibPCHRead( void )
/***************************/
{
    size_t len;
    LIB_LIST *lib_entry;

    CgInfoFreeLibs();
    for(;;) {
        len = PCHReadUInt();
        if( len == 0 ) break;
        lib_entry = CMemAlloc( len );
        PCHRead( lib_entry, len );
        RingAppend( &libRing, lib_entry );
    }
}
Beispiel #2
0
static void pragmaFini(         // FINISH PRAGMAS
    INITFINI* defn )            // - definition
{
    AUX_ENTRY       *next;
    AUX_ENTRY       *curr;
    AUX_INFO        *info;

    defn = defn;
    for( curr = AuxList; curr != NULL; curr = next ) {
        next = curr->next;
        info = curr->info;
        if( info != NULL ) {
            if( info->use > 1 ) {
                info->use--;
            } else {
                freeInfo( info );
#ifndef NDEBUG
                if( IsAuxInfoBuiltIn( info ) ) {
                    CFatal( "freeing a static calling convention info" );
                }
#endif
                if( !IsAuxInfoBuiltIn( info ) ) {
                    CMemFree( info );
                }
            }
        }
        CMemFree( curr );
    }
    freeInfo( &DefaultInfo );
    freeInfo( &CdeclInfo );
    freeInfo( &PascalInfo );
    freeInfo( &SyscallInfo );
    freeInfo( &OptlinkInfo );
    freeInfo( &StdcallInfo );
    freeInfo( &FastcallInfo );
#if _CPU == 386
    freeInfo( &Far16CdeclInfo );
    freeInfo( &Far16PascalInfo );
#endif
    freeInfo( &WatcallInfo );
    freeInfo( &FortranInfo );
    //CMemFreePtr( &FortranInfo.objname );
    AuxList = NULL;
    CgInfoFreeLibs();
    CgInfoFreeImports();
    CgInfoFreeImportsS();
}
Beispiel #3
0
static void pragmaFini(         // FINISH PRAGMAS
    INITFINI* defn )            // - definition
{
    register struct aux_entry *next;
    register void             *junk;

    defn = defn;
    next = AuxList;
    while( next != NULL ) {
        junk = next;
        if( next->info != NULL ) {
            if( next->info->use != 1 ) {
                next->info->use--;
            } else {
                freeInfo( next->info );
#ifndef NDEBUG
                if( IsAuxInfoBuiltIn( next->info ) ) {
                    CFatal( "freeing a static calling convention info" );
                }
#endif
                if( !IsAuxInfoBuiltIn( next->info ) ) {
                    CMemFree( next->info );
                }
            }
        }
        next = next->next;
        CMemFree( junk );
    }
    freeInfo( &DefaultInfo );
    freeInfo( &CdeclInfo );
    freeInfo( &PascalInfo );
    freeInfo( &SyscallInfo );
    freeInfo( &OptlinkInfo );
    freeInfo( &StdcallInfo );
    freeInfo( &FastcallInfo );
#if _CPU == 386
    freeInfo( &Far16CdeclInfo );
    freeInfo( &Far16PascalInfo );
#endif
    freeInfo( &WatcallInfo );
    freeInfo( &FortranInfo );
    //CMemFreePtr( &FortranInfo.objname );
    AuxList = NULL;
    CgInfoFreeLibs();
    CgInfoFreeImports();
    CgInfoFreeImportsS();
}