Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12714

Eliminate uses of realloc/malloc/free in C++ code

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Internal Code
    • None
    • Service Arch
    • Execution Team 2022-12-12, Execution Team 2022-12-26, Execution Team 2023-01-09

    Description

      The allocators we use don't have advantageous realloc behavior, and using malloc/free in C++ code prevents us from letting the "new handler" abort on allocation failures. That, in turn, leads us to a highly suspect set of macros in allocator.h, that may cause ODR violations or other surprising behaviors.

      The solution is to replace uses of malloc with new, free with delete and realloc with new, memcpy and delete, if they can't be eliminated outright.

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: