Updated outdated comment on lfsr_data_t's encoding

We no longer have a mode field, this has been replaced by the top 2 bits
of data.size.
This commit is contained in:
Christopher Haster
2024-02-25 12:35:14 -06:00
parent 692810e18e
commit ea88a48de2
2 changed files with 10 additions and 16 deletions
+5 -5
View File
@@ -1113,11 +1113,11 @@ static lfs_ssize_t lfsr_bd_progtag(lfs_t *lfs,
/// lfsr_data_t stuff /// /// lfsr_data_t stuff ///
// the top bits of data's size indicates the actual encoding // the top 2 bits of data's size indicates the actual encoding
// 0x0 => buffer pointer // 0b00 => in-RAM buffer
// 0x4 => inlined data // 0b01 => a single leb128
// 0x8 => on-disk reference // 0b10 => on-disk reference
// 0xc => concatenated data pointer // 0b11 => concatenated datas
#define LFSR_DATA_ONDISK 0x80000000 #define LFSR_DATA_ONDISK 0x80000000
#define LFSR_DATA_ISIMM 0x40000000 #define LFSR_DATA_ISIMM 0x40000000
#define LFSR_DATA_ISCAT 0xc0000000 #define LFSR_DATA_ISCAT 0xc0000000
+5 -11
View File
@@ -399,17 +399,11 @@ typedef struct lfs_mdir {
// Either an on-disk or in-device data pointer // Either an on-disk or in-device data pointer
// //
// The sign-bit of the size field indicates if the data is // The top 2 bits of data's size indicates the actual encoding
// in-device or on-disk. // 0b00 => in-RAM buffer
// // 0b01 => a single leb128
// After removing the sign bit, the size always encodes the // 0b10 => on-disk reference
// resulting size on-disk. // 0b11 => concatenated datas
//
// The exact representation of in-device data also depends on the
// mode field:
// - pointer to a RAM-backed buffer
// - inlined data able to fit at least 1 leb128
// - an array of concatenated datas
// //
// Note concatenated datas can only be 1 level deep. Concatenating // Note concatenated datas can only be 1 level deep. Concatenating
// concatenated datas would require recursion to resolve. // concatenated datas would require recursion to resolve.