Lines Matching defs:cs
655 void Cache_UnlinkLRU (cache_system_t *cs)
657 if (!cs->lru_next || !cs->lru_prev)
660 cs->lru_next->lru_prev = cs->lru_prev;
661 cs->lru_prev->lru_next = cs->lru_next;
663 cs->lru_prev = cs->lru_next = NULL;
666 void Cache_MakeLRU (cache_system_t *cs)
668 if (cs->lru_next || cs->lru_prev)
671 cache_head.lru_next->lru_prev = cs;
672 cs->lru_next = cache_head.lru_next;
673 cs->lru_prev = &cache_head;
674 cache_head.lru_next = cs;
687 cache_system_t *cs, *new;
710 cs = cache_head.next;
714 if (!nobottom || cs != cache_head.next)
716 if ( (byte *)cs - (byte *)new >= size)
721 new->next = cs;
722 new->prev = cs->prev;
723 cs->prev->next = new;
724 cs->prev = new;
733 new = (cache_system_t *)((byte *)cs + cs->size);
734 cs = cs->next;
736 } while (cs != &cache_head);
831 cache_system_t *cs;
836 cs = ((cache_system_t *)c->data) - 1;
838 cs->prev->next = cs->next;
839 cs->next->prev = cs->prev;
840 cs->next = cs->prev = NULL;
844 Cache_UnlinkLRU (cs);
856 cache_system_t *cs;
861 cs = ((cache_system_t *)c->data) - 1;
864 Cache_UnlinkLRU (cs);
865 Cache_MakeLRU (cs);
878 cache_system_t *cs;
891 cs = Cache_TryAlloc (size, false);
892 if (cs)
894 strncpy (cs->name, name, sizeof(cs->name)-1);
895 c->data = (void *)(cs+1);
896 cs->user = c;