fix: correct gcmask value in documentation#69
fix: correct gcmask value in documentation#69saschabuehrle wants to merge 1 commit intocloudwego:mainfrom
Conversation
The gcmask for the Object struct should be 1001, not 1010. Given the Object structure: - A string (base+0): pointer to string data - bit 1 - A string length (base+8): not a pointer - bit 0 - B int64 (base+16): not a pointer - bit 0 - C *[]byte (base+24): pointer - bit 1 The correct gcmask is 1001 (bits for base+0, base+8, base+16, base+24).
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
+ Coverage 2.70% 60.84% +58.14%
==========================================
Files 15 16 +1
Lines 2221 2222 +1
==========================================
+ Hits 60 1352 +1292
+ Misses 2155 716 -1439
- Partials 6 154 +148
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sorry to interrupt, I wanted to let you know that this PR is most probably entirely AI-generated, including replies to your comments. Just see the batch of PRs they opened recently to form your own opinion. I doubt they'll sign the CLA. |
Bug
Fixes #66 — The gcmask value in the documentation example was incorrect.
Fix
Changed to for the Object struct's gcmask.
Analysis
Given the Object structure:
The gcmask indicates which 8-byte aligned addresses contain pointers:
base+0: A string (contains pointer to string data) - bit 1base+8: A string length (not a pointer) - bit 0base+16: B int64 (not a pointer) - bit 0base+24: C *[]byte (pointer) - bit 1Therefore, the correct gcmask is 1001 (reading bits from left to right for base+0, base+8, base+16, base+24).
Testing
Verified by analyzing the memory layout and pointer positions in the Object struct.
Greetings, saschabuehrle