aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/blob.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-10-12 21:02:48 -0700
committerJason Ekstrand <[email protected]>2017-10-12 21:47:06 -0700
commit8ae03af4ed1ca47a106e5fd7b2d11ce4003aad54 (patch)
treee8c7ecf1fb5fd8a1d24b7cc9558b6bf7188b3b23 /src/compiler/blob.h
parent26f6d4e5c7f38ab1f55d4cdef7013cc3c730f298 (diff)
compiler/blob: Allow for fixed-size blobs with a NULL data pointer
These can be used to easily count up the number of bytes that will be required by "writing" it into the NULL 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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/blob.h b/src/compiler/blob.h
index e23e392eedd..ec80b78284c 100644
--- a/src/compiler/blob.h
+++ b/src/compiler/blob.h
@@ -96,6 +96,10 @@ blob_init(struct blob *blob);
* A fixed-size blob has a fixed block of data that will not be freed on
* blob_finish and will never be grown. If we hit the end, we simply start
* returning false from the write functions.
+ *
+ * If a fixed-size blob has a NULL data pointer then the data is written but
+ * it otherwise operates normally. This can be used to determine the size
+ * that will be required to write a given data structure.
*/
void
blob_init_fixed(struct blob *blob, void *data, size_t size);