4 ms·
> Isn't length + pointer... Basically a Pascal string? Unless I am mistaken. Length + pointer is a record string, a pascal string has the length at the head of
by masklinn 7mo ago
> Isn't length + pointer... Basically a Pascal string? Unless I am mistaken.
Length + pointer is a record string, a pascal string has the length at the head of the buffer, behind the pointer.
- nopurpose 7mo agoMany years ago when reading Redis code I saw the same pattern: they pass around simple pointer to data, but there is a fixed length metadata just before that.
- masklinn 7mo agoI assume it’s either Antirez’s sds or a variant / ancestor thereof, yes. It stores a control block at the head of the string, but the pointer points past that block, so it has metadata but “is” a C string.