Skip to content

Foundation Classes - Documentation update for TCollection#665

Merged
dpasukhi merged 3 commits into
Open-Cascade-SAS:IRfrom
dpasukhi:utf_conversion
Aug 8, 2025
Merged

Foundation Classes - Documentation update for TCollection#665
dpasukhi merged 3 commits into
Open-Cascade-SAS:IRfrom
dpasukhi:utf_conversion

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

@dpasukhi dpasukhi commented Aug 7, 2025

Enhance memory allocation for AsciiString and ExtendedString with padded size calculations. Improve comments for UTF8 conversion methods.

Enhance memory allocation for AsciiString and ExtendedString with padded size calculations.
Improve comments for UTF8 conversion methods.
@dpasukhi dpasukhi added this to the Release 8.0 milestone Aug 7, 2025
@dpasukhi dpasukhi self-assigned this Aug 7, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code labels Aug 7, 2025
@dpasukhi dpasukhi linked an issue Aug 7, 2025 that may be closed by this pull request
Copy link
Copy Markdown

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

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

The word 'Documntation' in the PR title contains a spelling error - it should be 'Documentation'.

Copilot uses AI. Check for mistakes.
@dpasukhi dpasukhi changed the title Foundation Classes - Documntation update for TCollection Foundation Classes - Documentation update for TCollection Aug 7, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Integration in Maintenance Aug 8, 2025
@dpasukhi dpasukhi merged commit 3c14e29 into Open-Cascade-SAS:IR Aug 8, 2025
23 checks passed
@dpasukhi dpasukhi deleted the utf_conversion branch August 8, 2025 09:31
@github-project-automation github-project-automation Bot moved this from Integration to Done in Maintenance Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Foundation Classes Containers, system calls wrappers, smart pointers and other low level of OCCT code 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

memory overrun in ToUTF8CString

3 participants