Skip to content

Conversation

thebentern
Copy link
Contributor

@thebentern thebentern commented Sep 5, 2025

While looking at some other memory leak vectors, this one came up as a fairly straightforward change to get rid of another heap allocation

@thebentern thebentern added the enhancement New feature or request label Sep 5, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces a dynamic String object with a fixed-size char buffer to address potential memory leak issues in the GPS probing functionality. The change optimizes memory usage by avoiding dynamic allocations during GPS chip detection.

Key changes:

  • Replaced dynamic String with fixed 256-byte char buffer
  • Implemented manual buffer management with bounds checking
  • Updated string operations to use C-style string functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@fifieldt
Copy link
Member

fifieldt commented Sep 6, 2025

Back when GPS probe was in its "unreliable" days, we used something similar to this. If this is the way to go (and I do not have anywhere near sufficient C++ knowledge to say one way or another), we must test this incredibly well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants