Skip to content

Feature request: reduce RAM consumption #43

@Danaozhong

Description

@Danaozhong

The library has a relatively high RAM footprint, making it difficult to use on low-spec embedded systems. Printing a table with 4 or 5 rows easly allocates several kB of RAM.
Jumping in the code, I noticed that in the background buffers are allocated for each cell of the table, before printing starts.
Would it be possible to selectively draw the table in lines? For example, something like this:

    for (size_t i = 0; i != ft_get_number_of_rows_to_print(table); ++i)
    {
        memset(buffer, 0, 128);
        if (0 == ft_print_single_row(table, i, buffer, 256))
        {
            printf(buffer);
        }
    }

So that in the background, only the necessary allocations are done for a single row, and the buffers are freed after printing out.
Judging from the code, this would mean major code changes regarding the cell buffer handling.

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