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 | |
parent | 681bd70b4f32a42cae128fbbb046a7e97e3f1a51 (diff) |
Static allocation of ttable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8820 a1c6a512-1295-4272-9138-f99709370657
-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; unsigned short hashkey; unsigned long hashbd; struct hashval hashcode[2][7][64]; -struct hashentry huge *ttable,*ptbl; +struct hashentry ttable[ttblsz]; +struct hashentry huge *ptbl; unsigned char history[8192]; short Mwpawn[64],Mbpawn[64],Mknight[2][64],Mbishop[2][64]; @@ -2348,14 +2349,9 @@ void NewGame() { /* ---- Initialize variables and reset board ---- */ void GNUChess_Initialize ( void ) { - int buffer_size; - /* no malloc sir, 64K should be enough for now */ - /*char ttablearray[65536];*/ - /*ttable = (struct hashentry *)ttablearray;*/ /*ttable = (struct hashentry *)malloc(ttblsz * (unsigned long)sizeof(struct hashentry));*/ - buffer_size = ttblsz * sizeof(struct hashentry); - ttable = (struct hashentry *)rb->plugin_get_buffer( &buffer_size ); + /* no malloc, statically allocated */ Level = 1; OperatorTime = 0; TCmoves = 60; |