Title: [159650] trunk/Source/WebCore
Revision
159650
Author
[email protected]
Date
2013-11-21 15:21:35 -0800 (Thu, 21 Nov 2013)

Log Message

Add !USE(NETWORK_CFDATA_ARRAY_CALLBACK)-guard
https://bugs.webkit.org/show_bug.cgi?id=124741

Reviewed by Alexey Proskuryakov.

Add !USE(NETWORK_CFDATA_ARRAY_CALLBACK)-guard around code that is unused
when building with feature NETWORK_CFDATA_ARRAY_CALLBACK.

Additionally, add a declaration for allocateSegment() with attribute WARN_UNUSED_RETURN
to have the compiler warn when the return value of this function is unused. Together with
warnings treated as errors this change will prevent a memory leak.

* platform/SharedBuffer.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (159649 => 159650)


--- trunk/Source/WebCore/ChangeLog	2013-11-21 23:20:38 UTC (rev 159649)
+++ trunk/Source/WebCore/ChangeLog	2013-11-21 23:21:35 UTC (rev 159650)
@@ -1,5 +1,21 @@
 2013-11-21  Daniel Bates  <[email protected]>
 
+        Add !USE(NETWORK_CFDATA_ARRAY_CALLBACK)-guard
+        https://bugs.webkit.org/show_bug.cgi?id=124741
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add !USE(NETWORK_CFDATA_ARRAY_CALLBACK)-guard around code that is unused
+        when building with feature NETWORK_CFDATA_ARRAY_CALLBACK.
+
+        Additionally, add a declaration for allocateSegment() with attribute WARN_UNUSED_RETURN
+        to have the compiler warn when the return value of this function is unused. Together with
+        warnings treated as errors this change will prevent a memory leak.
+
+        * platform/SharedBuffer.cpp:
+
+2013-11-21  Daniel Bates  <[email protected]>
+
         Remove unused functions from WebCore and WebKit2
         https://bugs.webkit.org/show_bug.cgi?id=124739
 

Modified: trunk/Source/WebCore/platform/SharedBuffer.cpp (159649 => 159650)


--- trunk/Source/WebCore/platform/SharedBuffer.cpp	2013-11-21 23:20:38 UTC (rev 159649)
+++ trunk/Source/WebCore/platform/SharedBuffer.cpp	2013-11-21 23:21:35 UTC (rev 159650)
@@ -38,6 +38,7 @@
 
 namespace WebCore {
 
+#if !USE(NETWORK_CFDATA_ARRAY_CALLBACK)
 static const unsigned segmentSize = 0x1000;
 static const unsigned segmentPositionMask = 0x0FFF;
 
@@ -51,6 +52,7 @@
     return position & segmentPositionMask;
 }
 
+static inline char* allocateSegment() WARN_UNUSED_RETURN;
 static inline char* allocateSegment()
 {
     return static_cast<char*>(fastMalloc(segmentSize));
@@ -60,6 +62,7 @@
 {
     fastFree(p);
 }
+#endif
 
 SharedBuffer::SharedBuffer()
     : m_size(0)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to