[Webkit-unassigned] [Bug 50385] [Qt] Make platform managing of OSAllocator better than r73106

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 2 11:03:54 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50385





--- Comment #7 from Geoffrey Garen <ggaren at apple.com>  2010-12-02 11:03:53 PST ---
> this patch moves some logic from cross platform code into Qt specific build system;

The old code wasn't cross-platform -- it just put the burden of selecting different code for different platforms on the .cpp file, instead of the platform's build project file.

> other ports would have to re-implement these guards now in their own port-specific mechanism

For minor platform differences, one or two port-specific #ifdefs in a shared file is the most expedient solution, and I agree, it's nice not to have to rewrite the whole file for each port.

However, in this case we have major platform differences -- for example, there is zero shared code between virtual memory allocation on Windows, POSIX, and Symbian.

In such a case, I don't see much benefit to artificially merging platform-specific implementations, and I do see some disadvantages:

* It doesn't match how major ports like Mac and Windows are organized.

* It doesn't match how WebCore is organized.

* It undermines the separation of concerns, and forces you to think about every permutation of ports for every line of port-specific code you write.

* Having to write an "#if OS(WINDOWS)" guard inside OSAllocatorWin.cpp is very surprising. The whole point of OSAllocatorWin.cpp is that you should only build it on Windows. 

* It litters the code with #ifdefs, and often nested #ifdefs, which degrade readability.

* It increases build times.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list