|
Message-ID: <0676baf7a43b636fb3f0a2c56bd8bf4e@smtp.hushmail.com> Date: Sun, 13 May 2012 21:44:43 +0200 From: magnum <john.magnum@...hmail.com> To: john-dev@...ts.openwall.com Subject: Re: Changes in common_opencl.c On 05/13/2012 09:15 PM, SAYANTAN DATTA wrote: > Hi Magnum, > > Multiple calls to opencl_init() funct is causing opencl compilation errors. When? How do I reproduce it? > The root cause of the problem is char *kernel_source isn't freed each time > after the build program() funct . Are you sure this is the problem? I am not. I understand opencl_init() may be called several times eg. when running --test (are there other situations?). But as far as I can see this would just mean a very slight memory leak - we'd do a new mem_calloc_tiny each time. Using calloc/free would fix this but I can't see how it would solve any worse problem than this memory leak? > Also the cleanup_tiny_memory() is only called once at program exit. > One solution is to use malloc() and free() for > allocating and deallocating *kernel_source. However if you have any > better solution then please post it. Feel free to submit a patch that use calloc/free, I do not have the time right now. If you do this, you might also want to set kernel_loaded=0 in opencl_init() as well as probably other similar things for supporting multiple invocations. magnum
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.