Skip to content

Improve Checks for Flushing and Overrun #21

Open
@phillipjohnston

Description

@phillipjohnston

Right now, we do this check per-character, which is quite inefficient:

	virtual void log_add_char_to_buffer(char c)
	{
		if(auto_flush() && (internal_size() == internal_capacity()))
		{
			flush();
		}
		else if (internal_size() == internal_capacity())
		{
			overrun_occurred_ = true;
		}

		log_putc(c);
	}

Ideally we'd check for the full contents of the string to be added to the log, splitting earlier than the character level. Perhaps this occurs in print()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions