diff options
Diffstat (limited to 'src/compiler/glsl/blob.h')
-rw-r--r-- | src/compiler/glsl/blob.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/glsl/blob.h b/src/compiler/glsl/blob.h index 9de12e6eb82..940c81e13b4 100644 --- a/src/compiler/glsl/blob.h +++ b/src/compiler/glsl/blob.h @@ -27,6 +27,7 @@ #include <stdbool.h> #include <stddef.h> #include <stdint.h> +#include <stdlib.h> #ifdef __cplusplus extern "C" { @@ -80,6 +81,16 @@ struct blob * blob_create(void); /** + * Destroy a blob and free its memory. + */ +static inline void +blob_destroy(struct blob *blob) +{ + free(blob->data); + free(blob); +} + +/** * Add some unstructured, fixed-size data to a blob. * * \return True unless allocation failed. |