[Webkit-unassigned] [Bug 165793] [GStreamer] use FastMalloc-based GstAllocator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 13 03:38:29 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=165793

--- Comment #2 from Xabier Rodríguez Calvar <calvaris at igalia.com> ---
Comment on attachment 296994
  --> https://bugs.webkit.org/attachment.cgi?id=296994
WIP

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

> Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp:161
> +        fprintf(stderr, "initializeGStreamer(): using FastMalloc allocator %p\n", allocator);

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

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

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

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:40
> +    mem->data = reinterpret_cast<guint8*>(mem) + headerSize;

uint8_t

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:53
> +static void gst_allocator_fast_malloc_free(GstAllocator*, GstMemory* mem)

I would ASSERT here if the allocator is right.

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

Proper typing?

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:89
> +    copy->data = reinterpret_cast<guint8*>(copy) + headerSize;

uint8_t

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:104
> +    auto* sharedMem = reinterpret_cast<GstMemoryFastMalloc*>(fastMalloc(sizeof(GstMemoryFastMalloc)));

Proper typing?

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:118
> +        auto* parent = reinterpret_cast<GstMemoryFastMalloc*>(mem1->base.parent);

Proper typing?

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:135
> +    auto* gobjectClass = G_OBJECT_CLASS(klass);
> +    gobjectClass->finalize = gst_allocator_fast_malloc_finalize;
> +
> +    auto* gstAllocatorClass = GST_ALLOCATOR_CLASS(klass);

Proper typing?

> Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.h:29
> +    guint8* data;

uint8_t

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161213/9cb323ac/attachment.html>


More information about the webkit-unassigned mailing list