毕业设计——Core Systems

来源:互联网 发布:mysql 表被锁住了 编辑:程序博客网 时间:2024/05/21 14:03
3月19 

      Core Systems 层从"内存分配”开始,打算采用“Pool Allocator”。处于实现方式研究阶段。
3月21
     “内存分配”跟我想象的不太一样,准备采用下面的方式:

     Memory allocator is fairly simple:

1)Allocate a huge chunk of memory on program initialization, decide on a fixed object size.
2)Generate a list of pointers to that memory, n*object_size apart, where 0<=n<=(memory_size/object_size)
3)During your program, if the memory is needed, take it off the list and return the pointer.
4)If the memory is freed (given back to the allocator), simply add it to the list.
5)If you need memory allocation for more than one size, create another instance of your allocator that uses the particular object size.
出处:http://www.gamedev.net/topic/585787-design-of-a-memory-allocator-for-game-engine/

4月10
c++的模板使用方式搞错,原来的设计只能作废。看来对对于内存分配我还没有真正理解,因为时间的关系,先暂停“内存分配”模块的工作,进行其它模块的开发。
优先那些必要的重点模块。
1.“模块启动、关闭”暂时只用一个“子系统类”来实现,不编写“子系统管理类”。
2.“引擎配置模块”就单纯编写一个INI读写类,暂时不知道要哪些接口,留白。
3.“日志模块”设计实现中(一个往指定文件中写数据的类)。

4月21
各模块都有了简单的实现,XML暂时就是将TinyXML包含进工程。
开始考虑资源层,在出现明显需求时,改善Core Systems 层。