[PATCH 1/2] msi: queue dynamically allocated strings in cond.y
James Hawkins
truiken at gmail.com
Sat Jan 2 14:00:04 CST 2010
On Sat, Jan 2, 2010 at 10:36 AM, Nathan Gallaher
<ngallaher at deepthought.org> wrote:
>
>
+struct cond_mem {
+ struct list entry;
+ void *ptr;
+};
+
+static void cond_free( void *info, void *ptr )
+{
+ COND_input *cond = (COND_input*) info;
+ struct cond_mem *mem, *safety;
+
+ LIST_FOR_EACH_ENTRY_SAFE( mem, safety, &cond->mem, struct cond_mem, entry )
+ {
+ if( mem->ptr == ptr )
+ {
+ msi_free( mem->ptr );
+ list_remove( &(mem->entry) );
+ msi_free( mem );
+ return;
+ }
+ }
+ ERR("Error freeing %p\n", ptr);
+}
This won't fly. cond_free needs to be an O(1) operation, like your
original patch.
--
James Hawkins
More information about the wine-devel
mailing list