diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-02-23 22:08:35 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-02-23 22:08:35 +0000 |
commit | 42295c438d5b973520fae5176d9a3b6ea02fc569 (patch) | |
tree | a4d64dbaf844b2057579e7879a118035dffa2c50 /apps | |
parent | 681bd70b4f32a42cae128fbbb046a7e97e3f1a51 (diff) | |
download | rockbox-42295c438d5b973520fae5176d9a3b6ea02fc569.tar.gz rockbox-42295c438d5b973520fae5176d9a3b6ea02fc569.zip |
Static allocation of ttable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8820 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/chessbox/gnuchess.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/plugins/chessbox/gnuchess.c b/apps/plugins/chessbox/gnuchess.c index 45ca66e778..879c083ce7 100644 --- a/apps/plugins/chessbox/gnuchess.c +++ b/apps/plugins/chessbox/gnuchess.c | |||
@@ -181,7 +181,8 @@ unsigned short PV,hint,Swag0,Swag1,Swag2,Swag3,Swag4; | |||
181 | unsigned short hashkey; | 181 | unsigned short hashkey; |
182 | unsigned long hashbd; | 182 | unsigned long hashbd; |
183 | struct hashval hashcode[2][7][64]; | 183 | struct hashval hashcode[2][7][64]; |
184 | struct hashentry huge *ttable,*ptbl; | 184 | struct hashentry ttable[ttblsz]; |
185 | struct hashentry huge *ptbl; | ||
185 | unsigned char history[8192]; | 186 | unsigned char history[8192]; |
186 | 187 | ||
187 | short Mwpawn[64],Mbpawn[64],Mknight[2][64],Mbishop[2][64]; | 188 | short Mwpawn[64],Mbpawn[64],Mknight[2][64],Mbishop[2][64]; |
@@ -2348,14 +2349,9 @@ void NewGame() { | |||
2348 | 2349 | ||
2349 | /* ---- Initialize variables and reset board ---- */ | 2350 | /* ---- Initialize variables and reset board ---- */ |
2350 | void GNUChess_Initialize ( void ) { | 2351 | void GNUChess_Initialize ( void ) { |
2351 | int buffer_size; | ||
2352 | /* no malloc sir, 64K should be enough for now */ | ||
2353 | /*char ttablearray[65536];*/ | ||
2354 | /*ttable = (struct hashentry *)ttablearray;*/ | ||
2355 | /*ttable = (struct hashentry *)malloc(ttblsz * | 2352 | /*ttable = (struct hashentry *)malloc(ttblsz * |
2356 | (unsigned long)sizeof(struct hashentry));*/ | 2353 | (unsigned long)sizeof(struct hashentry));*/ |
2357 | buffer_size = ttblsz * sizeof(struct hashentry); | 2354 | /* no malloc, statically allocated */ |
2358 | ttable = (struct hashentry *)rb->plugin_get_buffer( &buffer_size ); | ||
2359 | Level = 1; | 2355 | Level = 1; |
2360 | OperatorTime = 0; | 2356 | OperatorTime = 0; |
2361 | TCmoves = 60; | 2357 | TCmoves = 60; |