Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align to 4-byte boundaries for 32-bit environments #315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

unionsep
Copy link

@unionsep unionsep commented Sep 6, 2024

TL;DR

This Pull Request addresses memory alignment issues encountered in Go's 32-bit build environment.

Longer version

I need to run DataDog in a Go 32-bit build environment. While using DataDog/dd-trace-go.v1, I encountered the following panic error in datadog-go:

panic: unaligned 64-bit atomic operation

(Reference: BufferedMetricContext.go Line 53)

In a 32-bit build environment, it's sometimes not possible to align 64-bit data types correctly to an 8-byte boundary. To address this, I aligned to a 4-byte boundary using an underscore variable. This change allowed DataDog to operate correctly in the 32-bit build environment.

Although this is a rare case, I would appreciate it if you could consider incorporating this fix.

@unionsep unionsep marked this pull request as ready for review September 6, 2024 08:37
@unionsep unionsep requested a review from a team as a code owner September 6, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant