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:
19
ssl/bigint.c
19
ssl/bigint.c
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user