ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
bin_cache_entry_t Struct Reference

Binary PATH cache entry structure for binary detection caching. More...

Data Fields

char * bin_name
 Binary name string (allocated, owned by cache) - also used as uthash key.
 
bool in_path
 Whether binary was found in PATH (true = found, false = not found)
 
UT_hash_handle hh
 uthash handle
 

Detailed Description

Binary PATH cache entry structure for binary detection caching.

Represents a single cached binary PATH detection result. Maps a binary name to a boolean indicating whether the binary was found in PATH, avoiding expensive PATH searches for frequently checked binaries.

CORE FIELDS:

  • bin_name: Binary name (e.g., "llvm-symbolizer", "addr2line")
  • in_path: Whether binary was found in PATH during last check

USAGE:

This structure is used internally by the binary PATH detection cache:

  • Key: Binary name (hashed for hashtable lookup)
  • Value: Boolean indicating PATH presence

CACHE OPERATIONS:

  • Lookup: Fast O(1) hashtable lookup by binary name
  • Insertion: Cached after first PATH search
  • Lifetime: Owned by cache, freed on cache cleanup

PERFORMANCE BENEFITS:

PATH searching without caching requires:

  • Tokenizing PATH environment variable (expensive)
  • Stat/access system calls for each PATH directory (slow)
  • File system operations for each directory check (disk-bound)

With caching:

  • First check: Same cost as uncached (cache miss)
  • Subsequent checks: O(1) hashtable lookup (fast)
  • Eliminates redundant PATH searches

MEMORY MANAGEMENT:

  • bin_name string is allocated and owned by the cache
  • Do not free bin_name manually (cache manages it)
  • Entries are stored in hashtable (pre-allocated pool)
Note
This structure is used internally by the binary PATH detection system. Users should interact via system_find_binary_in_path() function.

Definition at line 126 of file system.c.

Field Documentation

◆ bin_name

char* bin_cache_entry_t::bin_name

Binary name string (allocated, owned by cache) - also used as uthash key.

Definition at line 128 of file system.c.

Referenced by platform_is_binary_in_path().

◆ hh

UT_hash_handle bin_cache_entry_t::hh

uthash handle

Definition at line 132 of file system.c.

◆ in_path

bool bin_cache_entry_t::in_path

Whether binary was found in PATH (true = found, false = not found)

Definition at line 130 of file system.c.

Referenced by platform_is_binary_in_path().


The documentation for this struct was generated from the following file: