Foundation Classes - Documentation update for TCollection#665
Merged
Conversation
Enhance memory allocation for AsciiString and ExtendedString with padded size calculations. Improve comments for UTF8 conversion methods.
There was a problem hiding this comment.
Pull Request Overview
This PR enhances memory allocation strategies for TCollection string classes by introducing padded size calculations and improves documentation for UTF-8 conversion methods. The changes focus on optimizing memory allocation patterns while providing better guidance for external API usage.
Key changes:
- Introduces helper functions for consistent padded memory allocation across AsciiString and ExtendedString classes
- Improves documentation for UTF-8 conversion methods with clearer buffer allocation guidance
- Adds comprehensive test coverage for string constructors, memory allocation, and UTF-8 conversion functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TCollection_ExtendedString.hxx | Enhanced documentation for UTF-8 conversion methods with buffer allocation examples |
| TCollection_ExtendedString.cxx | Added calculatePaddedSize helper function and unified memory allocation strategy |
| TCollection_AsciiString.cxx | Added calculatePaddedSize helper function with consistent padding logic |
| TCollection_ExtendedString_Test.cxx | Added comprehensive test coverage for UTF-8 conversion, constructors, and edge cases |
| TCollection_AsciiString_Test.cxx | Added test coverage for memory allocation, constructors, and padding behavior |
| //! Returns expected CString length in UTF8 coding. | ||
| //! It can be used for memory calculation before converting | ||
| //! to CString containing symbols in UTF8 coding. | ||
| //! Returns expected CString length in UTF8 coding (like strlen, without null terminator). |
There was a problem hiding this comment.
The word 'Documntation' in the PR title contains a spelling error - it should be 'Documentation'.
AtheneNoctuaPt
approved these changes
Aug 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhance memory allocation for AsciiString and ExtendedString with padded size calculations. Improve comments for UTF8 conversion methods.