-
Notifications
You must be signed in to change notification settings - Fork 140
Conversation
int[] columns = new int[values.Length]; | ||
GLib.Value[] vals = new GLib.Value[values.Length]; | ||
int n_values = 0; | ||
unsafe { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the most important optimization, as we invoke this pretty often in MD.
The parameters require only a value*, not a GValueArray
Means: |
Result in this diff: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Let's merge em after a day or two of local testing to make sure there aren't any oopses! It all looks fine to me though!
Also one thing to keep in mind - there are no guarantees about the contents of stackalloced memory. It looks like we always fully initialize all memory we allocate this way, but if you ever want allocate an extra byte for a null terminator (or whatever) do remember to explicitly write null to that byte! |
The stackallocs are mostly GLib.Value/Utf8String via marshal, so it's safe to assume we don't get uninitialized memory. |
No description provided.