Skip to content

Consider setting buffer_size in display constructor #20

@tomsci

Description

@tomsci

Raising this so I don't forget about it.

Right now we don't set buffer_size in the ST7789() constructor. This means every call to bitmap() and text() will malloc a temporary buffer. For a fullscreen image this means a 64K malloc every time. I managed to somehow hit an OOM error as a result of this (although I've no idea how I could've leaked or fragmented 8MB!). Maybe we should just take the 64KB penalty and keep the buffer around all the time, to reduce fragmentation? (the buffer_size has to be big enough for the largest image we're going to load, so setting a limit of no images larger than the screen size seems reasonable for now)

@MatthewWilkes what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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