<?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>65840</bug_id>
          
          <creation_ts>2011-08-07 23:17:21 -0700</creation_ts>
          <short_desc>Fix comment in NewSpace.h</short_desc>
          <delta_ts>2022-02-27 23:23:11 -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>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>65458</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zoltan Herczeg">zherczeg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>ggaren</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>447846</commentid>
    <comment_count>0</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2011-08-07 23:17:21 -0700</bug_when>
    <thetext>Wrong comments can be misleading when you need to fix a bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>447848</commentid>
    <comment_count>1</comment_count>
      <attachid>103203</attachid>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2011-08-07 23:23:30 -0700</bug_when>
    <thetext>Created attachment 103203
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448154</commentid>
    <comment_count>2</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2011-08-08 12:08:24 -0700</bug_when>
    <thetext>cc&apos;ing GC experts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448331</commentid>
    <comment_count>3</comment_count>
      <attachid>103203</attachid>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-08-08 15:56:48 -0700</bug_when>
    <thetext>Comment on attachment 103203
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=103203&amp;action=review

&gt; Source/JavaScriptCore/heap/NewSpace.h:88
&gt; +        // [ 128 - preciseStep, 256... 1024 )

I don&apos;t think this is true: the first imprecise size class is exactly 128, not 128 - preciseStep.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448485</commentid>
    <comment_count>4</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2011-08-09 02:36:31 -0700</bug_when>
    <thetext>&gt; I don&apos;t think this is true: the first imprecise size class is exactly 128, not 128 - preciseStep.

See bug 65458 (Depends on). The bug was that an allocation of 103 bytes is bigger than 95, which is the end of last precise class on 64 bit. So it is allocated from the first inprecise class. Or should it go to a precise class?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448711</commentid>
    <comment_count>5</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-08-09 11:49:45 -0700</bug_when>
    <thetext>&gt; See bug 65458 (Depends on). The bug was that an allocation of 103 bytes is bigger than 95, which is the end of last precise class on 64 bit. So it is allocated from the first inprecise class. Or should it go to a precise class?

Where to allocate is one question. Independently, this comment describes the size of the cells in the class. That size is 128, not 128 - preciseStep.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448995</commentid>
    <comment_count>6</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2011-08-09 23:29:54 -0700</bug_when>
    <thetext>&gt; Where to allocate is one question. Independently, this comment describes the size of the cells in the class. That size is 128, not 128 - preciseStep.

Are you sure? The comment said:

// [ 128, 256... 1024 )

The size of the first block is really 128, but the second is 128 as well, not 256, and the last is 128 as well, not 1024. Instead I think the comment describes the ranges, the first range is [128-256), the second is [256-384) ...

The growth rate is clearly linear:

static const size_t preciseCutoff = 128;
static const size_t impreciseStep = preciseCutoff;
return m_impreciseSizeClasses[(bytes - 1) / impreciseStep];</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449438</commentid>
    <comment_count>7</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2011-08-10 15:32:15 -0700</bug_when>
    <thetext>(gdb) disp cellSize
(gdb) run
[Switching to process 3491]
Running…
3: cellSize = 32
(gdb) c
Continuing.
3: cellSize = 64
(gdb) 
Continuing.
3: cellSize = 96
(gdb) 
Continuing.
4: cellSize = 128
(gdb) 
Continuing.
4: cellSize = 256
(gdb) 
Continuing.
4: cellSize = 384
(gdb) 
Continuing.
4: cellSize = 512
(gdb) 
Continuing.
4: cellSize = 640
(gdb) 
Continuing.
4: cellSize = 768
(gdb) 
Continuing.
4: cellSize = 896</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449621</commentid>
    <comment_count>8</comment_count>
    <who name="Zoltan Herczeg">zherczeg</who>
    <bug_when>2011-08-10 23:45:07 -0700</bug_when>
    <thetext>Oh, those brackets were confused me. [a,b) in mathematics means a range of numbers, where x &gt;= a and x &lt; b. Sorry for the misunderstanding.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>103203</attachid>
            <date>2011-08-07 23:23:30 -0700</date>
            <delta_ts>2022-02-27 23:23:11 -0800</delta_ts>
            <desc>patch</desc>
            <filename>0001-comment-fix.patch</filename>
            <type>text/plain</type>
            <size>1981</size>
            <attacher name="Zoltan Herczeg">zherczeg</attacher>
            
              <data encoding="base64">RnJvbSA4YmU1MWIxZWRlNTQ0OTczZjVkMGY4NGY0MWFmYmU4MGQ3YjFiNDUzIE1vbiBTZXAgMTcg
MDA6MDA6MDA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N1dG9mZiAvIHByZWNpc2VTdGVwIC0gMTsKIAotICAgICAgICAvLyBbIDEyOCwgMjU2Li4u
IDEwMjQgKQorICAgICAgICAvLyBbIDEyOCAtIHByZWNpc2VTdGVwLCAyNTYuLi4gMTAyNCApCiAg
ICAgICAgIHN0YXRpYyBjb25zdCBzaXplX3QgaW1wcmVjaXNlU3RlcCA9IHByZWNpc2VDdXRvZmY7
CiAgICAgICAgIHN0YXRpYyBjb25zdCBzaXplX3QgaW1wcmVjaXNlQ3V0b2ZmID0gbWF4Q2VsbFNp
emU7CiAgICAgICAgIHN0YXRpYyBjb25zdCBzaXplX3QgaW1wcmVjaXNlQ291bnQgPSBpbXByZWNp
c2VDdXRvZmYgLyBpbXByZWNpc2VTdGVwIC0gMTsKLS0gCjEuNy4yLjMKCg==
</data>
<flag name="review"
          id="98713"
          type_id="1"
          status="-"
          setter="ggaren"
    />
    <flag name="commit-queue"
          id="98714"
          type_id="3"
          status="-"
          setter="ntim"
    />
          </attachment>
      

    </bug>

</bugzilla>