-/* adds one more watch */
-VG_STATIC void watch_cache_board( struct cache_board *ptr ){
- if( ptr->ref_count >= 32 ){
- vg_fatal_error( "dynamic board watch missmatch (limit is 32)\n" );
- }
-
- ptr->ref_count ++;
-}
-
-/* if after this no more watches, places back into the volatile list */
-VG_STATIC void unwatch_cache_board( struct cache_board *ptr ){
- if( ptr->ref_count == 0 ){
- vg_fatal_error( "dynamic board unwatch missmatch (no watchers)\n" );
- }
-
- ptr->ref_count --;
- if( !ptr->ref_count ){
- struct cache_board *head = global_skateshop.cache_head,
- *tail = global_skateshop.cache_tail;
-
- if( tail ) tail->right = ptr;
- ptr->left = tail;
- global_skateshop.cache_tail = ptr;
-
- if( !head ) global_skateshop.cache_head = ptr;
- }
-}
-
-/* retrieve oldest pointer from the volatile list (and remove it) */
-VG_STATIC struct cache_board *lru_volatile_cache_board(void){
- struct cache_board *head = global_skateshop.cache_head,
- *tail = global_skateshop.cache_tail;
-
- if( head ){
- if( head == tail ) global_skateshop.cache_tail = NULL;
- global_skateshop.cache_head = head->right;
-
- head->left = NULL;
- head->right = NULL;
- return head;
- }
- else return NULL;
-}
-