Raxol.Terminal.MemoryManager (Raxol v0.5.0)

View Source

Manages memory usage and limits for the terminal emulator.

Summary

Functions

Checks and cleans up memory if needed.

Returns a specification to start this module under a supervisor.

Gets the current memory usage.

Checks if scrolling is needed based on memory usage.

Starts the memory manager process.

Updates memory usage for the given state.

Checks if the current memory usage is within limits.

Types

t()

@type t() :: %Raxol.Terminal.MemoryManager{
  current_memory: non_neg_integer(),
  max_memory: non_neg_integer(),
  memory_limit: non_neg_integer()
}

Functions

check_and_cleanup(state)

Checks and cleans up memory if needed.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_memory_usage(memory_manager)

Gets the current memory usage.

should_scroll?(memory_manager, state)

Checks if scrolling is needed based on memory usage.

start_link()

Starts the memory manager process.

update_usage(state)

Updates memory usage for the given state.

within_limits?(memory_manager, state)

Checks if the current memory usage is within limits.