mono / gtk-sharp

Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono
http://www.mono-project.com/GtkSharp
Other
428 stars 140 forks source link

[Gen] Optimize marshalling on some struct pinvokes #175

Closed Therzok closed 7 years ago

Therzok commented 7 years ago

This changes native signatures to use by-ref passing instead of having to marshal structs. The idea behind this is to avoid one extra allocation + free, box operation from StructureToPtr and reconstruction of the value after an unmanaged call MarshalReturnType from VirtualMethod was using the wrong delegation target. Also, now that the pango_glyph_item_free generated method has a different signature, bind a manual one so we can build and use it.

for 874404d2f0f41eec4cc0cf2e580194fcfd7f5492: https://gist.github.com/Therzok/18323659503725ad5bb5501477e0495f

Therzok commented 7 years ago

cc @alanmcgovern

Therzok commented 7 years ago

[OUTDATED] for b007e646948ba879ad6467cd216ca8b9f8977482: https://gist.github.com/Therzok/4e76d191033cc5f8fd5dde9b79ea0a1c

Therzok commented 7 years ago

between 2c8807e and 449d4e2 (this actually takes into account all the changes, as the previous variant might've been corrupting memory) https://gist.github.com/Therzok/f3582e15eb75379077af0bba6edcc3dc

Therzok commented 7 years ago

308d4d3d3d99ee8405c84ea75d093b551472f42a: https://gist.github.com/Therzok/955df4fda19dbbe3f260d3a9fbc895fd

Therzok commented 7 years ago

2bd3e23: https://gist.github.com/Therzok/48e4290a942ec7067a4938627877c9d5

Therzok commented 7 years ago

For those not faint of heart: https://gist.github.com/Therzok/9dbe15bf89d8e8ab8f7018474c34faad

945 files changed, 1307 insertions(+), 3004 deletions(-)

alanmcgovern commented 7 years ago

In general LGTM. However we should land it after C9 is fully branched. We're getting a bit close to the branch dates for me to be super comfortable landing big changes like this :)

Therzok commented 7 years ago

For fb725ee3664ae8341b257f43229211b89d0f9200: https://gist.github.com/Therzok/4017a9a6725f1be075e7911660aa6fa5

alanmcgovern commented 7 years ago

Lgtm