Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Jan 2013 15:59:06 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: Rejecting hashes in valid() due to memory allocation failures?

On 3 Jan, 2013, at 7:00 , Lukas Odzioba <lukas.odzioba@...il.com> wrote:
> 2013/1/1 magnum <john.magnum@...hmail.com>:
>> Thanks, I'll commit your patch. I think the best is to add a 'static void done(void)' function that frees resources using MEM_FREE macro. For now you could add an atexit(done) to init(), and for next core version we'll have done() as a format method (with a self parameter added).
> 
> I can do it, but why not use mem_alloc_tiny() for candidates and results?
> This memory is allocated only once, and we do not need to free it.

It's a problem with large arrays, especially on GPU. But sure, for most CPU formats you could use mem_alloc_tiny. But then you could also use a static array. I think most formats that allocate dynamically (typically OpenMP aware formats) should eventually be converted to mem_alloc/MEM_FREE. But that is lower prio.

magnum

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ