Skip to content

Conversation

@Alan-Jowett
Copy link

This code base uses an ALLOC/REALLOC/FREE macros almost everywhere, but it appears as if cstringstream.c was missed. This change updates this file to match the rest of the cod base.

  • Convert direct malloc() calls to ALLOC() macro in cstringstream.c
  • Convert direct realloc() calls to REALLOC() macro in cstringstream.c
  • Convert direct free() calls to FREE() macro in cstringstream.c
  • Add util.h include to cstringstream.c for macro availability
  • Ensures consistent memory management and error handling across codebase
  • All existing tests continue to pass

Changes:

  • 3 malloc() → ALLOC() conversions
  • 1 realloc() → REALLOC() conversion
  • 2 free() → FREE() conversions

This change standardizes memory allocation to use the centralized memory management macros, providing consistent error handling through MMalloc/MMrealloc when USE_MM is not defined, and automatic pointer zeroing with the FREE() macro.

- Convert direct malloc() calls to ALLOC() macro in cstringstream.c
- Convert direct realloc() calls to REALLOC() macro in cstringstream.c
- Convert direct free() calls to FREE() macro in cstringstream.c
- Add util.h include to cstringstream.c for macro availability
- Ensures consistent memory management and error handling across codebase
- All existing tests continue to pass

Changes:
- 3 malloc() → ALLOC() conversions
- 1 realloc() → REALLOC() conversion
- 2 free() → FREE() conversions

This change standardizes memory allocation to use the centralized
memory management macros, providing consistent error handling through
MMalloc/MMrealloc when USE_MM is not defined, and automatic pointer
zeroing with the FREE() macro.

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19172131886

Details

  • 0 of 7 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 32.992%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cstringstream.c 0 7 0.0%
Totals Coverage Status
Change from base Build 19166190186: 0.0%
Covered Lines: 9789
Relevant Lines: 29671

💛 - Coveralls

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.

2 participants