Skip to content

Replace realloc(3) and maybe malloc(3) with std::vector #10813

Open

Description

@Al2Klimov

Especially Process::IOThreadProc() unnecessarily calls realloc(3) in every single iteration.

Activity

  1. Al2Klimov commented on Apr 24, 2026

    @Al2Klimov
    MemberAuthor

    ... and the new operator! Just had a look at IdoMysqlConnection#Escape() and thought: srsly? new char[] and delete []? This could be a RAII std::vector!

  2. qorexdevs commented on May 22, 2026

    @qorexdevs

    I can take this one.

    Plan is to replace manual realloc/malloc buffer growth in IdoMysqlConnection::Escape() with std::vector<char> while keeping output and error handling unchanged. If there is a nearby test target for this path, I will add coverage in the same PR.

  3. julianbrost commented on May 22, 2026

    @julianbrost
    Member

    @qorexdevs You have already created the PR #10821 for this issue, didn't sign the CLA and closed the PR again. Please convince me that you're not a bot going around in circles, otherwise, please stop.

  4. qorexdevs commented on May 22, 2026

    @qorexdevs

    Fair point. PR #10821 was a separate attempt, and I closed it because the CLA was still blocking review. This issue is still open, and I claimed it so I can work the current code path in one branch once the CLA is sorted. If you'd rather I step back until the CLA is signed, I'll do that.

  5. aditya-prasad1 commented on Jul 1, 2026

    @aditya-prasad1

    Hi @julianbrost @Al2Klimov! I'd like to work on this issue.

    I was planning to replace the manual memory management with RAII containers in Process::IOThreadProc() and IdoMysqlConnection::Escape(), as mentioned in the comments. Is that the intended scope for this issue? If so, I'd be happy to work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

core/qualityImprove code, libraries, algorithms, inline docsgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions