Skip to content

fix: correct gcmask value in documentation#69

Open
saschabuehrle wants to merge 1 commit intocloudwego:mainfrom
saschabuehrle:fix/issue-66
Open

fix: correct gcmask value in documentation#69
saschabuehrle wants to merge 1 commit intocloudwego:mainfrom
saschabuehrle:fix/issue-66

Conversation

@saschabuehrle
Copy link

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:

type Object struct {
    A string    // 16 bytes (2 words) - pointer to data + length
    B int64     // 8 bytes (1 word) - not a pointer  
    C *[]byte   // 8 bytes (1 word) - pointer
}

The gcmask indicates which 8-byte aligned addresses contain pointers:

  • base+0: A string (contains pointer to string data) - bit 1
  • base+8: A string length (not a pointer) - bit 0
  • base+16: B int64 (not a pointer) - bit 0
  • base+24: C *[]byte (pointer) - bit 1

Therefore, 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

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).
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.84%. Comparing base (65e6157) to head (6508e4d).
⚠️ Report is 10 commits behind head on main.

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     
Flag Coverage Δ
unit 60.84% <ø> (+58.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pawamoy
Copy link

pawamoy commented Mar 20, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

gcmask typo

3 participants