Skip to content

Stop loading/saving the whole document through a duplicate buffer #29

Description

@KernelPhreak

LoadStartupFile allocates file size + 1, reads the whole file, null-terminates it, then calls SetWindowTextA. That means during load you temporarily have at least two copies...your heap buffer and the edit control’s internal buffer.

Same issue in SaveFile: it asks the edit control for the entire text length, allocates a buffer, copies all text into it, then writes it.

This matters a lot for large files. A 50 MB file currently needs a temporary 50 MB buffer on top of the control’s own storage. Streaming reduces peak memory drastically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions