microsoft / microsoft/STL

<xlocale>: Allocation function mismatch in _Crt_new_delete

Open
#160 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug vNext
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

Describe the bug
_Crt_new_delete::new uses _malloc_dbg while _Crt_new_delete::delete uses free.

Command-line test case
STL version (git commit or Visual Studio version): cd8fee0

Expected behavior
Matching heap allocation calls.

Additional context
We found this issue while using a custom memory manager, which does not override dbg versions, only malloc/free.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate _Crt_new_delete::new and _Crt_new_delete::delete in the STL implementation and compare the heap allocation calls they use. Reproduce the command-line case against the referenced STL commit or Visual Studio version, and consider the issue done when both operations use matching allocation calls compatible with a memory manager that overrides malloc/free.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.