<?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>99655</bug_id>
          
          <creation_ts>2012-10-17 16:44:16 -0700</creation_ts>
          <short_desc>V8::AdjustAmountOfExternalAllocatedMemory calls in WebCoreStringResource are inaccurate</short_desc>
          <delta_ts>2014-12-16 00:49:55 -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>New Bugs</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>burg</cc>
    
    <cc>haraken</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>744780</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-10-17 16:44:16 -0700</bug_when>
    <thetext>V8::AdjustAmountOfExternalAllocatedMemory calls in WebCoreStringResource are inaccurate

The v8 API (according to api.cpp):
intptr_t V8::AdjustAmountOfExternalAllocatedMemory(intptr_t change_in_bytes) {

We&apos;re calling this function, assuming that AtomicString/String are take up 2 bytes per character:
                v8::V8::AdjustAmountOfExternalAllocatedMemory(2 * m_atomicString.length());

Which is wrong... In many ways.  Especially in the context of 8-bit strings, or even just the fact that strings are shared?

But I&apos;m not sure how much the accuracy of this reporting matters (if at all).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744782</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-10-17 16:46:43 -0700</bug_when>
    <thetext>Or the fact that if m_plainString is already isAtomic() than m_atomicString is never causing any allocation. :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>