Re: HeapAlloc vs. malloc. How does HeapAlloc work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Petr Svoboda skrev:
I am little bit interested in Wine source code. There is one thing I don't understand. How does HeapAlloc() work? Is it the same behavior as Winapi HeapAlloc()?

Yes.

If so then I have to check NULL value after each calling of this function, don't I?

Yes. You have to do that with malloc() too, so why "vs malloc"?

Nobody is checking NULL value of include_defs and later there is strcpy() with HeapAlloc as parameter.

Well, it's the age-old hazards of programming in C: people get lazy about error checking, which has caused various problems in all kinds of software. (In this case, perhaps thinking that if you're out of memory, then you're in so much trouble anyway that the null-pointer-dereference exception to follow isn't such a big deal...)




[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux