void pc_freeall(struct pcache *pc) { struct list *lp; if ( ! pc->mm ) return; while ( (lp = l_pop(&pc->avail)) ) mem_free(pc->mm, lp); while ( (lp = l_pop(&pc->empty)) ) mem_free(pc->mm, lp); }
void* getRegistryDataPtr( K* reg_key ) { push( reg_key ); l_gettable( LUA_REGISTRYINDEX ); if( ! l_islightuserdata() ) { l_pop(); throw Lua_Error( "not user_data" ); } void* data = l_touserdata(); l_pop(); return data; }