Mercurial > hg > Game > Cerium
view TaskManager/kernel/memory/MemList.h @ 370:4748fd7dcd89 draft
change TaskManger & memory/* & Random
author | aaa |
---|---|
date | Wed, 29 Jul 2009 15:09:36 +0900 |
parents | 93b33cecba37 |
children | 205e4a4af635 |
line wrap: on
line source
#ifndef MEMLIST #define MEMLIST #include <stdlib.h> #include "MemorySegment.h" class MemList : 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