Bug 240472 - [WPE][GTK] Add more padding to WebKitWebView vtable
Summary: [WPE][GTK] Add more padding to WebKitWebView vtable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks: GTK4
  Show dependency treegraph
 
Reported: 2022-05-16 12:00 PDT by Michael Catanzaro
Modified: 2023-01-26 08:31 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-05-16 12:00:46 PDT
We're running out of room in the WebKitWebView vtable. Let's add more padding here than we're likely to need (when building with newer API versions).

And let's also review other vtables and add more padding where it looks useful.
Comment 1 Michael Catanzaro 2023-01-24 13:55:29 PST
Actually most vtables will no longer be public after bug #243663, except notably WebKitWebView. This object should receive a _very_ healthy amount of padding IMO.
Comment 2 Michael Catanzaro 2023-01-25 12:16:03 PST
So currently the vtable is 29 bytes for GTK, with zero bytes of padding remaining. WPE uses a little bit less and has 5 bytes of padding remaining.

Let's go crazy and add 30 bytes. I think we can afford to splurge here because web views are relatively rare.
Comment 3 Michael Catanzaro 2023-01-25 12:19:24 PST
Pull request: https://github.com/WebKit/WebKit/pull/9139
Comment 4 Adrian Perez 2023-01-25 14:53:34 PST
(In reply to Michael Catanzaro from comment #2)
> So currently the vtable is 29 bytes for GTK, with zero bytes of padding
> remaining. WPE uses a little bit less and has 5 bytes of padding remaining.
> 
> Let's go crazy and add 30 bytes. I think we can afford to splurge here
> because web views are relatively rare.

Nitpick: 30 *pointer* entries (plus 29 existing). That makes for 236 bytes
on 32-bit platforms, and 472 bytes on 64-bit ones. Still reasonable to add
that many, I think.
Comment 5 Michael Catanzaro 2023-01-25 15:57:01 PST
Oh yeah... because pointers require more than one byte. You'll never hear me claim to be competent.
Comment 6 EWS 2023-01-26 08:31:06 PST
Committed 259425@main (5737721c0eb3): <https://commits.webkit.org/259425@main>

Reviewed commits have been landed. Closing PR #9139 and removing active labels.