Comment on StgArrWords vs StgArrBytes
authorArash Rouhani <rarash@student.chalmers.se>
Thu, 21 Nov 2013 13:17:45 +0000 (14:17 +0100)
committerAustin Seipp <austin@well-typed.com>
Fri, 22 Nov 2013 14:04:53 +0000 (08:04 -0600)
See #8552

Signed-off-by: Arash Rouhani <rarash@student.chalmers.se>
Reviewed-by: Austin Seipp <austin@well-typed.com>
includes/rts/storage/Closures.h

index 09e7021..2704128 100644 (file)
@@ -135,11 +135,18 @@ typedef struct StgBlockingQueue_ {
     struct MessageBlackHole_ *queue;
 } StgBlockingQueue;
 
+/* This struct should be called StgArrBytes rather than StgArrWords.
+ *
+ * One might be very tempted to store the number of words in the bytes field,
+ * but the garbage collector will erase your data then.
+ *
+ * It's name is for historical reasons, see #3800
+ */
 typedef struct {
     StgHeader  header;
     StgWord    bytes;
     StgWord    payload[FLEXIBLE_ARRAY];
-} StgArrWords;
+} StgArrWords; // TODO: s/StgArrWords/StgArrBytes (#8552)
 
 typedef struct {
     StgHeader   header;