Mercurial > hg > Game > Cerium
view TaskManager/kernel/memory/MemList.h @ 1546:61164c687b29 draft
fix GpuScheduler flip
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 05 Feb 2013 13:15:46 +0900 |
parents | 205e4a4af635 |
children |
line wrap: on
line source
#ifndef MEMLIST #define MEMLIST #include <stdlib.h> #include "MemorySegment.h" class MemList : public MemorySegment { public: MemorySegment* pool; MemorySegment* first; MemorySegment* last; // TaskManager 側で create する //MemList* createMemList(uint32 size, uint32 count); MemList(MemorySegment* ms) { first = last = this; next = prev = this; pool = ms; } ~MemList() { free(pool); } void addFirst(MemorySegment* e); void addLast(MemorySegment* e); MemorySegment* getFirst(); MemorySegment* getLast(); int remove(MemorySegment* e); MemorySegment* poll(); void moveToFirst(MemorySegment* e); // or use(); MemorySegment* get(int index); }; #endif