Permalink
Browse files

Comment on StgArrWords vs StgArrBytes

See #8552

Signed-off-by: Arash Rouhani <rarash@student.chalmers.se>
Reviewed-by: Austin Seipp <austin@well-typed.com>
  • Loading branch information...
1 parent 1bffa2b commit ac5ff6422fb9e143c38e6cdcf16280de200cb880 @Tarrasch Tarrasch committed with thoughtpolice Nov 21, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 includes/rts/storage/Closures.h
@@ -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;

0 comments on commit ac5ff64

Please sign in to comment.