<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer] use FastMalloc-based GstAllocator"
   href="https://bugs.webkit.org/show_bug.cgi?id=165793#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer] use FastMalloc-based GstAllocator"
   href="https://bugs.webkit.org/show_bug.cgi?id=165793">bug 165793</a>
              from <span class="vcard"><a class="email" href="mailto:calvaris&#64;igalia.com" title="Xabier Rodríguez Calvar &lt;calvaris&#64;igalia.com&gt;"> <span class="fn">Xabier Rodríguez Calvar</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=296994&amp;action=diff" name="attach_296994" title="WIP">attachment 296994</a> <a href="attachment.cgi?id=296994&amp;action=edit" title="WIP">[details]</a></span>
WIP

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=296994&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=296994&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp:161
&gt; +        fprintf(stderr, &quot;initializeGStreamer(): using FastMalloc allocator %p\n&quot;, allocator);</span >

I would GST_INFO this, though it would require to add a debug category for this.

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:36
&gt; +    auto* mem = reinterpret_cast&lt;GstMemoryFastMalloc*&gt;(fastAlignedMalloc(alignment + 1, headerSize + allocationSize));</span >

I prefer typed things when they are non-trivial, which IMHO is  the case.

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:40
&gt; +    mem-&gt;data = reinterpret_cast&lt;guint8*&gt;(mem) + headerSize;</span >

uint8_t

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:53
&gt; +static void gst_allocator_fast_malloc_free(GstAllocator*, GstMemory* mem)</span >

I would ASSERT here if the allocator is right.

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:82
&gt; +    auto* copy = reinterpret_cast&lt;GstMemoryFastMalloc*&gt;(fastAlignedMalloc(alignment + 1, headerSize + allocationSize));</span >

Proper typing?

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:89
&gt; +    copy-&gt;data = reinterpret_cast&lt;guint8*&gt;(copy) + headerSize;</span >

uint8_t

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:104
&gt; +    auto* sharedMem = reinterpret_cast&lt;GstMemoryFastMalloc*&gt;(fastMalloc(sizeof(GstMemoryFastMalloc)));</span >

Proper typing?

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:118
&gt; +        auto* parent = reinterpret_cast&lt;GstMemoryFastMalloc*&gt;(mem1-&gt;base.parent);</span >

Proper typing?

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:135
&gt; +    auto* gobjectClass = G_OBJECT_CLASS(klass);
&gt; +    gobjectClass-&gt;finalize = gst_allocator_fast_malloc_finalize;
&gt; +
&gt; +    auto* gstAllocatorClass = GST_ALLOCATOR_CLASS(klass);</span >

Proper typing?

<span class="quote">&gt; Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.h:29
&gt; +    guint8* data;</span >

uint8_t</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>