[Webkit-unassigned] [Bug 38572] [WTFURL] Add core URL parser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 6 13:20:40 PDT 2010


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





--- Comment #21 from Brett Wilson (Google) <brettw at chromium.org>  2010-05-06 13:20:39 PST ---
Adam, I'm confused about why this is all implemented in a header file. The old
code had concrete types only in header files. Then it had templatized versions
in the .cc files. The intent of this was to ensure there would be exactly one
copy of each of the two versions of the code globally in the entire project.
Since we know there are exactly two possible implementations of each template,
we can do this trick to help the compiler generate exactly the two versions it
needs globally.

My understanding of templates in headers is that the compiler must generate all
version of the code used in any particular source file and include that in the
object file, since it doesn't know what other stuff that object file might be
linked to in the future. This can possibly generate a huge amount of duplicated
code. Then my understanding is that optimizing linkers will try to clean up
this mess, but this is imperfect, doesn't happen in debug mode, and slows down
linking.

If all compilers we use are guaranteed not to generate duplicate code in this
case, and it doesn't slow down compiling and linking, I'm fine having these in
a header. But I'm currently quite uncomfortable with that approach and I much
prefer the concrete types in public APIs.

-- 
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