Mesa (main): util/blob: Clarify rules on blob::data

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 19 02:02:27 UTC 2022


Module: Mesa
Branch: main
Commit: c21065c87a912aa317e05d27a3e914ffbf436c66
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c21065c87a912aa317e05d27a3e914ffbf436c66

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Tue Feb 15 12:29:56 2022 +0100

util/blob: Clarify rules on blob::data

Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15028>

---

 src/util/blob.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/blob.h b/src/util/blob.h
index e1e156eb43f..051eaa01674 100644
--- a/src/util/blob.h
+++ b/src/util/blob.h
@@ -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. */



More information about the mesa-commit mailing list