这里的sizeof(char)是不是有问题?
- Dominant language
- C++
- Stars
- 1.8k
- Forks
- 352
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/alibaba/havenask/blob/35344cbf0c5fb2445f183538ae9f329cdc35def2/aios/autil/autil/PackDataFormatter.h#L105
```
size_t offsetLen = baseAddr[offset];
char *offsetAddr = baseAddr + offset + sizeof(char);
size_t offsetEndCursor = offset + sizeof(char) + offsetLen * (varNum - 1);
```
看代码,感觉sizeof(char) 应该换成 sizeof(offsetLen)才对啊,这里的sizeof(char)是什么含义呢
Contributor guide
No contributing guide indexed for this repository
Research direction
Inspect line 105 of aios/autil/autil/PackDataFormatter.h and trace how offsetLen, offsetAddr, and offsetEndCursor represent the packed data layout. Compare the use of sizeof(char) with sizeof(offsetLen) and verify which byte width the format requires. Done means the offset calculations match the intended serialized layout and the concern is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100