reflac
Re-encode FLAC files without decoding
TLDR
Recompress a directory of FLAC files
Enable maximum compression (very slow)
Display filenames as they are processed
Recurse into subdirectories
Preserve file modification times
SYNOPSIS
reflac [program] [program_arguments]
PARAMETERS
program
The executable file of the program you want to check for memory leaks.
program_arguments
Any arguments that need to be passed to the program being checked.
DESCRIPTION
reflac is a tool used to detect memory leaks and reference counting errors in C and C++ programs. It works by wrapping standard memory allocation and deallocation functions (like malloc, free, new, and delete) and tracking all allocated memory. It also tracks reference counts for C++ objects, identifying instances where objects are not properly deallocated or where reference counts are inconsistent, leading to potential memory leaks or use-after-free errors.
reflac can pinpoint the exact location in the source code where the memory was allocated but not freed, or where reference counts were mismanaged. This helps developers to quickly identify and fix memory management bugs, which are a common source of instability and security vulnerabilities in C/C++ applications. It often works by overriding memory allocation functions and using environment variables to define special reflac behavior. reflac is invaluable in debugging complex software projects to find the root cause of memory leaks.
CAVEATS
reflac relies on wrapping memory allocation functions, which can sometimes interfere with custom memory management schemes used by programs. Furthermore, correctly identifying reference counting issues requires careful configuration and may not be effective in all C++ codebases. Some implementations may need special environment variables set to execute correctly.
ENVIRONMENT VARIABLES
The behavior of reflac can often be controlled via environment variables. These variables dictate various settings, such as enabling or disabling specific checks, configuring output formats, and specifying thresholds for memory usage. Check your reflac version documentation for a list of supported variables.
OUTPUT INTERPRETATION
The output of reflac typically includes information about the address of the leaked memory, the size of the leak, and the location in the source code where the memory was allocated. This output is critical for debugging memory management issues, as it precisely indicates the source of the memory leak.
SEE ALSO
valgrind(1), mtrace(1)