[Botan-devel] Why Pooling_Allocator?\

Jack Lloyd lloyd at randombit.net
Thu Oct 13 11:34:35 EDT 2005


On Thu, Oct 13, 2005 at 08:25:39PM +0800, Matt Johnston wrote:

>              real_mem[j].in_use = false;
>  
> +         remove_empty_buffers(real_mem);
>           return;
>           }
>  
> -   remove_empty_buffers(real_mem);
>  
>     throw Internal_Error("Pooling_Allocator: Unknown pointer was freed");
>     }

Oh wow. Seriously dumb mistake on my part; the only time real_mem is cleared
out of empty buffers is when someone attempts to free a bad pointer... in all
cases where a valid pointer was deallocated, the return statement above gets
run.

I made some changes to the allocators back in 1.4.4; it's probably been like
this since and this is just the first time someone has run something long
enough that real_mem becamse large enough to cause problems. The PK algorithms
cause a pretty fair amount of allocation/deallocation per operation due to
temporaries in BigInt expressions and things like that, so in the case of
20,000 RSA signatures real_mem probably had many many thousands of elements.

-J



More information about the botan-devel mailing list