08-28-25 Lab 1

Valgrind is not natively supported on recent versions of macOS, but it’s possible to run it for C++ memory analysis by using Docker-based solutions or by turning to native Apple tools and compiler sanitizers[1][2][3]. For the most up-to-date and reliable memory testing, using AddressSanitizer or the built-in leaks command is generally preferred on modern macOS[4][5][3][6].

Using Valgrind via Docker on macOS

Native macOS Alternatives

Summary Table

Method Setup Usage Comments
Valgrind via Docker Docker install Rebuild code in Linux container, run with Valgrind Most detailed, slower[2][3]
AddressSanitizer None (built-in) Compile with -fsanitize=address, run natively Fast, works on Apple Silicon[4][5][7]
leaks tool None (built-in) Run leaks --atExit -- ./program Basic, lightweight[3][6]

On current versions of macOS, AddressSanitizer or the Apple leaks command offer the fastest and most stable C++ memory testing without the need for Linux containers. Valgrind remains available through Docker if advanced reporting is needed


Digital Logic

When to put transistors in serialized or parallel

Build a NOT out of NANDS

Build an AND out of NANDS

Build an OR out of NANDS