![]() |
![]() |
![]() |
![]() |
<GByteArray>
(define-values (%return) (byte-array:free array free-segment))
Frees the memory allocated by the GByteArray. If free_segment
is
TRUE
it frees the actual byte data. If the reference count of
array
is greater than one, the GByteArray wrapper is preserved but
the size of array
will be set to zero.
(define-values (%return) (byte-array:free-to-bytes array))
Transfers the data from the GByteArray into a new immutable GBytes.
The GByteArray is freed unless the reference count of array
is greater
than one, the GByteArray wrapper is preserved but the size of array
will be set to zero.
This is identical to using g_bytes_new_take()
and g_byte_array_free()
together.
(define-values (%return) (byte-array:new))
Creates a new GByteArray with a reference count of 1.
(define-values (%return) (byte-array:new-take data))
Create byte array containing the data. The data will be owned by the array
and will be freed with g_free()
, i.e. it could be allocated using g_strdup()
.
(define-values (%return len) (byte-array:steal array len))
Frees the data in the array and resets the size to zero, while the underlying array is preserved for use elsewhere and returned to the caller.