mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
use XP_REALLOC now that it's fixes
This commit is contained in:
parent
04b8c09128
commit
050a68ce42
1 changed files with 7 additions and 24 deletions
|
@ -1,7 +1,7 @@
|
||||||
/* -*-mode: C; compile-command: "../../scripts/ndkbuild.sh"; -*- */
|
/* -*-mode: C; compile-command: "../../scripts/ndkbuild.sh"; -*- */
|
||||||
/*
|
/*
|
||||||
* Copyright © 2009-2010 by Eric House (xwords@eehouse.org). All
|
* Copyright © 2009 - 2011 by Eric House (xwords@eehouse.org). All rights
|
||||||
* rights reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
|
@ -1372,28 +1372,11 @@ Java_org_eehouse_android_xw4_jni_XwJNI_dict_1iter_1makeIndex
|
||||||
|
|
||||||
dict_makeIndex( data->dict, data->depth, idata );
|
dict_makeIndex( data->dict, data->depth, idata );
|
||||||
|
|
||||||
Tile* tmp1 = idata->prefixes;
|
idata->prefixes = XP_REALLOC( data->mpool, idata->prefixes,
|
||||||
idata->prefixes = XP_MALLOC( data->mpool,
|
idata->count * data->depth *
|
||||||
idata->count * data->depth *
|
sizeof(*idata->prefixes) );
|
||||||
sizeof(*idata->prefixes) );
|
idata->indices = XP_REALLOC( data->mpool, idata->indices,
|
||||||
XP_MEMCPY( idata->prefixes, tmp1, idata->count * data->depth *
|
idata->count * sizeof(*idata->indices) );
|
||||||
sizeof(*idata->prefixes) );
|
|
||||||
XP_FREE( data->mpool, tmp1 );
|
|
||||||
|
|
||||||
/* XP_REALLOC is broken, causes crashes when passed to XP_FREE in the
|
|
||||||
destructor below. Fix or remove. */
|
|
||||||
/* idata->prefixes = XP_REALLOC( data->mpool, idata->prefixes, */
|
|
||||||
/* idata->count * data->depth * */
|
|
||||||
/* sizeof(*idata->prefixes) ); */
|
|
||||||
|
|
||||||
DictPosition* tmp2 = idata->indices;
|
|
||||||
idata->indices = XP_MALLOC( data->mpool,
|
|
||||||
idata->count * sizeof(*idata->indices) );
|
|
||||||
XP_MEMCPY( idata->indices, tmp2,
|
|
||||||
idata->count * sizeof(*idata->indices) );
|
|
||||||
XP_FREE( data->mpool, tmp2 );
|
|
||||||
/* idata->indices = XP_REALLOC( data->mpool, idata->indices, */
|
|
||||||
/* idata->count * sizeof(*idata->indices) ); */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue