Skip to content

Custom malloc/realloc/free and disable stdlib #16

@KeinR

Description

@KeinR

Sometimes we don't have access to the standard library, and/or we want to use custom allocation functions. Thus, it would make sense to add in some defines that can be set by the user of the library before the header is included. These would define memory allocation functions. There will also be a define that controls whether stdio is used, and also remove the *_create_with_file functions to prevent compilation errors.
stb_image is an example implementation of this.
Of course, it would be trivial for the user to manually modify the source code, and the license is permissive enough. However, it is better to have this be done in a well-defined manner, signed off by someone who has a more intimate knowledge of the code, and therefore is less likely to make mistakes than some impatient newbie running %s/malloc/my_malloc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions