Mercurial > hg > Members > kono > Cerium
changeset 44:b51daa049bc3
*** empty log message ***
author | gongo |
---|---|
date | Thu, 14 Feb 2008 19:49:43 +0900 |
parents | db136fb5c21d |
children | 494a19b053c5 |
files | TaskManager/kernel/ppe/BufferManager.cc |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/BufferManager.cc Thu Feb 14 19:37:14 2008 +0900 +++ b/TaskManager/kernel/ppe/BufferManager.cc Thu Feb 14 19:49:43 2008 +0900 @@ -1,16 +1,17 @@ +#include <stdio.h> #include <stdlib.h> #include "BufferManager.h" #include "error.h" BufferManager::BufferManager(int siz) { - buffer_db_size = siz; + buffer_db_size = siz*4; } void BufferManager::init(void) { - buffer_db = new void*[buffer_db_size*4]; + buffer_db = new void*[buffer_db_size]; buffer_db_index = 0; } @@ -38,9 +39,9 @@ BufferManager::switch_buffer(void* cur) { int next_index; - int max = buffer_db_size*4; + int max = buffer_db_size; - for (int i = 0; i < max; i = i + 2) { + for (int i = 0; i < buffer_db_size; i = i + 2) { if (cur == buffer_db[i]) { next_index = (int)(buffer_db[i+1]); return buffer_db[i + next_index];