summaryrefslogtreecommitdiffstats
path: root/src/compiler/blob.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-10-11 09:44:33 -0700
committerJason Ekstrand <[email protected]>2017-10-12 21:47:06 -0700
commit49bb9f785af8349f3245bc223cb7e0e40b9fa243 (patch)
treec4d2ef614b9de4a62d480d0493a1cd857e15ff4e /src/compiler/blob.h
parent0e3bd56c6ea783dbc93fce71cec98ab859782a81 (diff)
compiler/blob: Switch to init/finish instead of create/destroy
There's no reason why that tiny bit of memory needs to be on the heap. We always put blob_reader on the stack, so why not do the same with the writable blob. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/compiler/blob.h')
-rw-r--r--src/compiler/blob.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/compiler/blob.h b/src/compiler/blob.h
index 4cbbb01b15d..8a7a28b4f3c 100644
--- a/src/compiler/blob.h
+++ b/src/compiler/blob.h
@@ -79,21 +79,18 @@ struct blob_reader {
};
/**
- * Create a new, empty blob.
- *
- * \return The new blob, (or NULL in case of allocation failure).
+ * Init a new, empty blob.
*/
-struct blob *
-blob_create(void);
+void
+blob_init(struct blob *blob);
/**
- * Destroy a blob and free its memory.
+ * Finish a blob and free its memory.
*/
static inline void
-blob_destroy(struct blob *blob)
+blob_finish(struct blob *blob)
{
free(blob->data);
- free(blob);
}
/**