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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Service Arch
    • Execution Team 2022-12-12, Execution Team 2022-12-26, Execution Team 2023-01-09

      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.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: