[Webkit-unassigned] [Bug 49791] [GTK] Implement SharedMemory for WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 12 08:47:10 PST 2011


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





--- Comment #8 from Amruth Raj <amruthraj at motorola.com>  2011-01-12 08:47:09 PST ---
(In reply to comment #6)
> (From update of attachment 78527 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=78527&action=review
> 
> Looks good, but consider using GLib functions. If it's not possible, I'll re-review.
> 
> > WebKit2/Platform/gtk/SharedMemoryGtk.cpp:55
> > +    if ((lseek(fd, size - 1, SEEK_SET) == -1) || (write(fd, "", 1) != 1)) {
> > +        close(fd);
> > +        return 0;
> > +    }
> 
> Is this just verifying that the file is writable?
It sets the size of the file by moving size bytes and writing a character at the end.
> 
> > WebKit2/Platform/gtk/SharedMemoryGtk.cpp:61
> > +    void* mappedMemory = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
> > +    if (mappedMemory == MAP_FAILED) {
> > +        close(fd);
> > +        return 0;
> > +    }
> 
> Is it possible to use GMappedFile here? I think it makes sense to use GLib function wherever possible. This will make this function platform independent and also prevent the need for the above code.
Done. Used GMappedFile with the new patch.
> 
> > WebKit2/Platform/gtk/SharedMemoryGtk.cpp:77
> > +    void* mappedMemory = mmap(0, size, mode, MAP_SHARED, fd, 0);
> > +    if (mappedMemory == MAP_FAILED) {
> > +        close(fd);
> > +        return 0;
> > +    }
> 
> Ditto.
Done.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list