[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:24:25 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 7fccfe746b6c292613024a4a685476799ce063c5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 22 06:05:46 2010 +0000

    2010-01-21  Kwang Yul Seo  <skyul at company100.net>
    
            Reviewed by Maciej Stachowiak.
    
            Add fastStrDup to FastMalloc
            https://bugs.webkit.org/show_bug.cgi?id=33937
    
            The new string returned by fastStrDup is obtained with fastMalloc,
            and can be freed with fastFree. This makes the memory management
            more consistent because we don't need to keep strdup allocated pointers
            and free them with free(). Instead we can use fastFree everywhere.
    
            * wtf/FastMalloc.cpp:
            (WTF::fastStrDup):
            * wtf/FastMalloc.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53677 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index aa3556f..9c523e7 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-21  Kwang Yul Seo  <skyul at company100.net>
+
+        Reviewed by Maciej Stachowiak.
+
+        Add fastStrDup to FastMalloc
+        https://bugs.webkit.org/show_bug.cgi?id=33937
+
+        The new string returned by fastStrDup is obtained with fastMalloc,
+        and can be freed with fastFree. This makes the memory management 
+        more consistent because we don't need to keep strdup allocated pointers
+        and free them with free(). Instead we can use fastFree everywhere.
+
+        * wtf/FastMalloc.cpp:
+        (WTF::fastStrDup):
+        * wtf/FastMalloc.h:
+
 2010-01-21  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Maciej Stachowiak.
diff --git a/JavaScriptCore/wtf/FastMalloc.cpp b/JavaScriptCore/wtf/FastMalloc.cpp
index fad0bd8..7b14809 100644
--- a/JavaScriptCore/wtf/FastMalloc.cpp
+++ b/JavaScriptCore/wtf/FastMalloc.cpp
@@ -179,6 +179,17 @@ void* fastZeroedMalloc(size_t n)
     memset(result, 0, n);
     return result;
 }
+
+char* fastStrDup(const char* src)
+{
+    int len = strlen(src) + 1;
+    char* dup = static_cast<char*>(fastMalloc(len));
+
+    if (dup)
+        memcpy(dup, src, len);
+
+    return dup;
+}
     
 TryMallocReturnValue tryFastZeroedMalloc(size_t n) 
 {
diff --git a/JavaScriptCore/wtf/FastMalloc.h b/JavaScriptCore/wtf/FastMalloc.h
index d379291..74d4307 100644
--- a/JavaScriptCore/wtf/FastMalloc.h
+++ b/JavaScriptCore/wtf/FastMalloc.h
@@ -33,6 +33,7 @@ namespace WTF {
     void* fastZeroedMalloc(size_t);
     void* fastCalloc(size_t numElements, size_t elementSize);
     void* fastRealloc(void*, size_t);
+    char* fastStrDup(const char*);
 
     struct TryMallocReturnValue {
         TryMallocReturnValue(void* data)
@@ -188,6 +189,7 @@ using WTF::tryFastZeroedMalloc;
 using WTF::tryFastCalloc;
 using WTF::tryFastRealloc;
 using WTF::fastFree;
+using WTF::fastStrDup;
 
 #ifndef NDEBUG    
 using WTF::fastMallocForbid;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list