Пример #1
0
static void GrowTable( file_table *tab )
/**************************************/
{
    tab->len++;
    if( !(tab->len & VBL_ARRAY_MASK) ) {        // it will overflow
        tab->tab = DWRREALLOC( tab->tab,
                   (tab->len + VBL_ARRAY_DELTA) * sizeof(filetab_entry) );
    }
}
Пример #2
0
void DWRStackPush(                          // PUSH ITEM ON THE STACK
    dr_stack *stk,                          // -- stack to push on
    uint_32 val )                           // -- value to push
/***********************/
{
    if( stk->free >= stk->size ) {
        stk->size *= 2;
        stk->stack = DWRREALLOC( stk->stack, stk->size * sizeof( uint_32 ) );
    }

    stk->stack[stk->free] = val;
    stk->free += 1;
}
Пример #3
0
static void ScopePush( dr_scope_stack *stack, dr_handle entry )
/*************************************************************/
{
    if( stack->stack == NULL ) {
        stack->stack = DWRALLOC( SCOPE_GUESS * sizeof( dr_handle ) );
    }
    if( stack->free >= stack->size ) {
        stack->size += SCOPE_GUESS;
        stack->stack = DWRREALLOC( stack->stack, stack->size * sizeof( dr_handle ) );
    }

    stack->stack[stack->free] = entry;
    stack->free += 1;
}
Пример #4
0
static void DWRTrimTableSize( file_table *tab )
/*********************************************/
{
    tab->tab = DWRREALLOC( tab->tab, tab->len * sizeof(filetab_entry) );
}