<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>50385</bug_id>
          
          <creation_ts>2010-12-02 07:26:21 -0800</creation_ts>
          <short_desc>[Qt] Make platform managing of OSAllocator better than r73106</short_desc>
          <delta_ts>2010-12-02 13:34:09 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt, QtTriaged</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Csaba Osztrogonác">ossy</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>ggaren</cc>
    
    <cc>jturcotte</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>paroga</cc>
    
    <cc>yael</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>316134</commentid>
    <comment_count>0</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2010-12-02 07:26:21 -0800</bug_when>
    <thetext>.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316140</commentid>
    <comment_count>1</comment_count>
      <attachid>75375</attachid>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2010-12-02 07:35:53 -0800</bug_when>
    <thetext>Created attachment 75375
proposed fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316142</commentid>
    <comment_count>2</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2010-12-02 07:38:44 -0800</bug_when>
    <thetext>Patrick, Jocelyn, could you verify if the win case is good for all win/wince platform?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316229</commentid>
    <comment_count>3</comment_count>
      <attachid>75375</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-12-02 10:28:20 -0800</bug_when>
    <thetext>Comment on attachment 75375
proposed fix

EWS bots are green, so r=me.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316233</commentid>
    <comment_count>4</comment_count>
    <who name="Laszlo Gombos">laszlo.gombos</who>
    <bug_when>2010-12-02 10:31:11 -0800</bug_when>
    <thetext>To me this seems like an opposite direction on where we want to go - this patch moves some logic from cross platform code into Qt specific build system; other ports would have to re-implement these guards now in their own port-specific mechanism.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316238</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-12-02 10:36:50 -0800</bug_when>
    <thetext>This patch came out of a discussion I started by email, so I&apos;ll paste that here for context:

&gt; I ran into some trouble today with the Qt build system. I wanted to use separate files to separate concerns about different OS&apos;s like so:
&gt; 
&gt; OSAllocator.h // cross-platform header
&gt; OSAllocatorPosix.cpp // used on POSIX OS&apos;s
&gt; OSAllocatorWin.cpp // used on Windows
&gt;
&gt; This fits the convention we use in WebCore, and it avoids cluttering files with #ifdefs and discordant implementations.
&gt;
&gt; It worked fine for most ports, but not for Qt, because Qt uses the same build project for both Linux and Windows.
&gt;
&gt; Is there any way to make portions of Qt&apos;s build project conditional based on OS, or to use different projects on different OS&apos;s?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316253</commentid>
    <comment_count>6</comment_count>
    <who name="Laszlo Gombos">laszlo.gombos</who>
    <bug_when>2010-12-02 11:00:46 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; This patch came out of a discussion I started by email, so I&apos;ll paste that here for context:

Thanks Geoffrey.

&gt; &gt; This fits the convention we use in WebCore, and it avoids cluttering files with #ifdefs and discordant implementations.

I think the convention you referring to in WebCore is different as that is relevant for files specific to a single port (e.g. Gtk or Qt). Files in this patch could be shared between ports.

This was discussed in webkit-dev but I can not seems to find the thread anymore. The summary of the discussion is here - http://trac.webkit.org/wiki/Porting%20Macros%20plan.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316257</commentid>
    <comment_count>7</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-12-02 11:03:53 -0800</bug_when>
    <thetext>&gt; this patch moves some logic from cross platform code into Qt specific build system;

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

&gt; 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&apos;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&apos;t see much benefit to artificially merging platform-specific implementations, and I do see some disadvantages:

* It doesn&apos;t match how major ports like Mac and Windows are organized.

* It doesn&apos;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 &quot;#if OS(WINDOWS)&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316262</commentid>
    <comment_count>8</comment_count>
    <who name="Patrick R. Gansterer">paroga</who>
    <bug_when>2010-12-02 11:12:37 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; Patrick, Jocelyn, could you verify if the win case is good for all win/wince platform?
I didn&apos;t compile the new OSAllocatorWin.cpp with WinCE, but I don&apos;t think _this_ change will cause any troubles for WinCE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316321</commentid>
    <comment_count>9</comment_count>
      <attachid>75375</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-12-02 12:09:40 -0800</bug_when>
    <thetext>Comment on attachment 75375
proposed fix

Clearing flags on attachment: 75375

Committed r73179: &lt;http://trac.webkit.org/changeset/73179&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316322</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-12-02 12:09:45 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>316397</commentid>
    <comment_count>11</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2010-12-02 13:34:09 -0800</bug_when>
    <thetext>I talked this over with some other folks, and the rough consensus was:

- Separating completely different platform implementations into different .cpp files is good;
- Surrounding a file like OSAllocatorWin.cpp with &quot;#if OS(WINDOWS)&quot; is not terribly harmful, so we&apos;re willing to do it if it makes some build systems simpler;
- However, building more than one platform implementation file (for example, OSAllocatorWin.cpp and OSAllocatorPosix.cpp) in the same build system is not recommended practice.

Ultimately, this probably argues against the #ifdef changes in r73179. I don&apos;t think there&apos;s an immediate need to roll them out, however, going forward, I think Laszlo is right that we should keep platform-specific implementation files #ifdef&apos;d.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>75375</attachid>
            <date>2010-12-02 07:35:53 -0800</date>
            <delta_ts>2010-12-02 12:09:40 -0800</delta_ts>
            <desc>proposed fix</desc>
            <filename>1.patch</filename>
            <type>text/plain</type>
            <size>2878</size>
            <attacher name="Csaba Osztrogonác">ossy</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBi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