util/blob: Clarify rules on blob::data
authorConnor Abbott <cwabbott0@gmail.com>
Tue, 15 Feb 2022 11:29:56 +0000 (12:29 +0100)
committerMarge Bot <emma+marge@anholt.net>
Sat, 19 Feb 2022 01:25:46 +0000 (01:25 +0000)
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15028>

src/util/blob.h

index e1e156e..051eaa0 100644 (file)
@@ -47,7 +47,10 @@ extern "C" {
  */
 
 struct blob {
-   /* The data actually written to the blob. */
+   /* The data actually written to the blob. Never read or write this directly
+    * when serializing, use blob_reserve_* and blob_overwrite_* instead which
+    * check for out_of_memory and handle fixed-size blobs correctly.
+    */
    uint8_t *data;
 
    /** Number of bytes that have been allocated for \c data. */