GBytes: substantial internal rework
authorRyan Lortie <desrt@desrt.ca>
Tue, 2 Dec 2014 18:16:25 +0000 (13:16 -0500)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Fri, 10 Jul 2015 09:47:42 +0000 (11:47 +0200)
commite61d3441fb707b032251846c3f6e853d99b69945
treec4c62e9e6d9ea6ce2ec08257bd14288abfe50f68
parent8638fe6875159c93d44a9c985aafdb39e4ac60f8
GBytes: substantial internal rework

We have a wide variety of different sources of data for GBytes.

Instead of having all possibilities inside of a single structure type,
add a 'type' field and a couple of subtypes.

This also forces us to clean up our access to the ->data pointer from
all over the code which may become a problem in the future if we want to
lazy-map memfd GBytes instances by keeping the data pointer as NULL
until we are ready to use it.

We also introduce a new type of GBytes: 'inline'.  This allows us to
make a single allocation instead of two in the g_bytes_new() case.
glib/gbytes.c