Thursday, September 16, 2004

vtable layout and lookup

struct cA ;

struct A_vtbl
{
void (__stdcall* pfn_mem_fun)( struct cA* this, int v ) ;
void (__stdcall* pfn_mem_fun2)( const struct cA* this ) ;
void (__stdcall* pfn_mem_fun3)( struct cA* this ) ;
void (__stdcall* pfn_destructor)( struct cA* this ) ;
};

struct cA
{
struct A_vtbl* vptr ;
char c1 ;
int i ;
char c2[1] ;
};

void cfun( struct cA* pa )
{
//pa->mem_fun2() ;
pa->vptr->pfn_mem_fun2(pa) ;
//pa->mem_fun(100) ;
pa->vptr->pfn_mem_fun(pa,100);
}

Install/Upgrade NVIDI Driver in Ubuntu for CUDA SDK

Most linux distribution comes with the Nouveau https://nouveau.freedesktop.org/wiki/ display driver configured. If you need to use NVIDIA...