1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

memory reductions

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@131 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2007-10-01 21:49:12 +00:00
parent 91f0c4bec0
commit 18cde1355d
7 changed files with 48 additions and 25 deletions

View File

@ -96,8 +96,6 @@ BI_CTX *bi_initialize(void)
*/
void bi_terminate(BI_CTX *ctx)
{
bigint *p, *pn;
bi_depermanent(ctx->bi_radix);
bi_free(ctx, ctx->bi_radix);
@ -110,6 +108,20 @@ void bi_terminate(BI_CTX *ctx)
abort();
}
bi_clear_cache(ctx);
free(ctx);
}
/**
*@brief Clear the memory cache.
*/
void bi_clear_cache(BI_CTX *ctx)
{
bigint *p, *pn;
if (ctx->free_list == NULL)
return;
for (p = ctx->free_list; p != NULL; p = pn)
{
pn = p->next;
@ -117,7 +129,8 @@ void bi_terminate(BI_CTX *ctx)
free(p);
}
free(ctx);
ctx->free_count = 0;
ctx->free_list = NULL;
}
/**