Example #1
0
File: dbgcv.c Project: JWasm/JWlink
void CVInitModule( mod_entry *obj )
/****************************************/
// called before pass 1 is done on the module
{
    _PermAlloc( obj->d.cv, sizeof( cvmodinfo ) );
    memset( obj->d.cv, 0, sizeof( cvmodinfo ) );
}
Example #2
0
static void *OS2PagedRelocInit( offset size, int unitsize )
/***************************************************************/
/* For some OS/2 formats we have to split up the structure off the grp_relocs
 * field up into small bits to ensure that we don't get structure allocations
 * > 64K. This is stored basically as a 2-d array */
{
    void **     mem;
    void **     start;
    offset      pageidx;
    offset      idxhigh;
    unsigned    idxlow;
    unsigned    allocsize;

    pageidx = OSF_PAGE_COUNT( size );
    idxhigh = OSF_RLIDX_HIGH( pageidx );
    _PermAlloc( mem, ( idxhigh + 1 ) * sizeof( void * ) );
    start = mem;
    allocsize = OSF_RLIDX_MAX * unitsize;
    while( idxhigh > 0 ) {
        _ChkAlloc( *mem, allocsize );
        memset( *mem, 0, allocsize );
        mem++;
        idxhigh--;
    }
    idxlow = OSF_RLIDX_LOW( pageidx );
    if( idxlow != 0 ) {
        allocsize = idxlow * unitsize;
        _ChkAlloc( *mem, allocsize );
        memset( *mem, 0, allocsize );
    }
    return( start );
}
Example #3
0
static bool AddClass( void )
/**************************/
{
    list_of_names       *ovlclass;

    _PermAlloc( ovlclass, sizeof( list_of_names ) + Token.len );
    memcpy( ovlclass->name, Token.this, Token.len );
    ovlclass->name[ Token.len ] = '\0';
    ovlclass->next_name = OvlClasses;
    OvlClasses = ovlclass;
    return( TRUE );
}
Example #4
0
static void SetOvlClasses( void )
/*******************************/
// make sure the overlay loader is always "overlayed".
{
    list_of_names       *ovlmgr;

    if( OvlClasses != NULL ) {
        _PermAlloc( ovlmgr, sizeof( list_of_names ) + OVL_MGR_CL_LEN );
        memcpy( ovlmgr->name, OvlMgrClass, OVL_MGR_CL_LEN+1 );
        ovlmgr->next_name = OvlClasses;
        OvlClasses = ovlmgr;
    }
}
Example #5
0
static infilelist * AllocEntry( char *name, path_entry *path )
/************************************************************/
{
    infilelist *        entry;

    _PermAlloc( entry, sizeof(infilelist) );
    entry->name = AddStringStringTable( &PermStrings, name );
    entry->path_list = path;
    entry->prefix = NULL;
    entry->handle = NIL_HANDLE;
    entry->cache = NULL;
    entry->len = 0;
    entry->flags = 0;
    return entry;
}
Example #6
0
static reloc_info *AllocRelocInfo( void )
/****************************************/
/* allocate a relocation information block */
{
    reloc_info      *info;

    _PermAlloc( info, sizeof( reloc_info ) );       /* allocate more */
    info->sizeleft = RELOC_PAGE_SIZE;
    _LnkAlloc( info->loc.addr, RELOC_PAGE_SIZE );
    if( info->loc.addr == NULL ) {
        info->loc.spill = SpillAlloc( RELOC_PAGE_SIZE );
        info->sizeleft |= RELOC_SPILLED;
    }
    return( info );
}
Example #7
0
void DwarfInitModule( mod_entry *mod )
/*******************************************/
{
    _PermAlloc( mod->d.d, sizeof( dwarfmodinfo ) );
    memset( mod->d.d, 0, sizeof( dwarfmodinfo ) );
}