src/GLdispatch/GLdispatch.c
static void FixupDispatchTable(__GLdispatchTable *dispatch)
{
    DBG_PRINTF(20, "dispatch=%p\n", dispatch);
    CheckDispatchLocked();

    __GLdispatchProcEntry *curProc;
    void *procAddr;
    void **tbl = (void **)dispatch->table;

    /*
     * For each proc in the extProcList, compare its gen# against that of
     * the context. If greater, then fix up the dispatch table to contain
     * the right entrypoint.
     * XXX optimization: could we assume that the list is sorted by generation
     * number and hence early out once we reach gen# <= the context's?
     */
    glvnd_list_for_each_entry(curProc, &extProcList, entry) {
        if (curProc->generation > dispatch->generation) {
            assert(curProc->offset != -1);
            assert(curProc->procName);

            procAddr = (void*)(*dispatch->getProcAddress)(
                curProc->procName,
                dispatch->getProcAddressParam);

            tbl[curProc->offset] = procAddr ? procAddr : (void *)noop_func;
            DBG_PRINTF(20, "extProc procName=%s, addr=%p, noop=%p\n",
                       curProc->procName, procAddr, noop_func);
        }
    }

    dispatch->generation = latestGeneration;
}
/*
 * Fix up a dispatch table. Calls to this function must be protected by the
 * dispatch lock.
 */
Fix up a dispatch table. Calls to this function must be protected by the
dispatch lock.
Fix up a dispatch table . Calls to this function must be protected by the dispatch lock .
static void FixupDispatchTable(__GLdispatchTable *dispatch)
{
    DBG_PRINTF(20, "dispatch=%p\n", dispatch);
    CheckDispatchLocked();
    __GLdispatchProcEntry *curProc;
    void *procAddr;
    void **tbl = (void **)dispatch->table;
    glvnd_list_for_each_entry(curProc, &extProcList, entry) {
        if (curProc->generation > dispatch->generation) {
            assert(curProc->offset != -1);
            assert(curProc->procName);
            procAddr = (void*)(*dispatch->getProcAddress)(
                curProc->procName,
                dispatch->getProcAddressParam);
            tbl[curProc->offset] = procAddr ? procAddr : (void *)noop_func;
            DBG_PRINTF(20, "extProc procName=%s, addr=%p, noop=%p\n",
                       curProc->procName, procAddr, noop_func);
        }
    }
    dispatch->generation = latestGeneration;
}
static void FixupDispatchTable ( __GLdispatchTable * dispatch ) { DBG_PRINTF ( 20 , " \n " , dispatch ) ; CheckDispatchLocked ( ) ; __GLdispatchProcEntry * curProc ; void * procAddr ; void * * tbl = ( void * * ) dispatch -> table ; glvnd_list_for_each_entry ( curProc , & extProcList , entry ) { if ( curProc -> generation > dispatch -> generation ) { assert ( curProc -> offset != -1 ) ; assert ( curProc -> procName ) ; procAddr = ( void * ) ( * dispatch -> getProcAddress ) ( curProc -> procName , dispatch -> getProcAddressParam ) ; tbl [ curProc -> offset ] = procAddr ? procAddr : ( void * ) noop_func ; DBG_PRINTF ( 20 , " \n " , curProc -> procName , procAddr , noop_func ) ; } } dispatch -> generation = latestGeneration ; }
Fix up a dispatch table.
Fix up a dispatch table .
/*
     * For each proc in the extProcList, compare its gen# against that of
     * the context. If greater, then fix up the dispatch table to contain
     * the right entrypoint.
     * XXX optimization: could we assume that the list is sorted by generation
     * number and hence early out once we reach gen# <= the context's?
     */