[dplayx 02/29] Tests for DirectPlayCreate

Francois Gouget fgouget at free.fr
Thu Jul 10 07:06:57 CDT 2008


On Wed, 9 Jul 2008, Kai Blin wrote:

> On Wednesday 09 July 2008 19:15:34 Ismael Barros wrote:
> >
> > >> +    heap = HeapCreate( 0, 0, 0 );
> > >
> > > Do you have any reason to create your own heap? Each windows process
> > > already comes equipped with a standard heap you can obtain using the API
> 
> > That's what I used in the begining, but I've got some HeapAllocs that
> > I don't free. This is intended, as freeing that memory would make the
> > code unnecessarily complex, I can't use static local variables (I use
> > the result of the function inside the same ok() or trace()), and
> > loosing memory is always undesirable but not critical in a test case.
> > The main problem was to get yelled when valgrind complains about the
> > memory leak, and Kai Blin advised me to use my own heap to avoid
> > valgrind complains.
> > Anyway is this is too dirty I'll have no problem in doing it "correctly".
> 
> This might just be me getting used to Samba's libtalloc too much, but what 
> downside is there to allocate all memory for a test case on one heap and just 
> freeing that once you're done?

Would it cause trouble for Valgrind? I.e. will Valgrind recognize that 
the heap destruction actually frees all the relevant HeapAlloc() 
calls? Or will it just report massive memory leakage?

-- 
Francois Gouget <fgouget at free.fr>              http://fgouget.free.fr/
                  Hiroshima '45 - Czernobyl '86 - Windows '95



More information about the wine-devel mailing list