C memory management
Malloc/free discipline, valgrind traces.
Tutor Profile
MS Computer Science from EPFL Lausanne. Specializes in C memory management and C++ RAII and modern ownership patterns.
About the Tutor
Marcus finished his CS masters at EPFL, then spent four years writing systems software for a high-frequency trading desk before he started tutoring full time. The kernel-bypass networking stack, the lock-free ring buffers, the cache-line-aligned struct layouts. The work was relentless on memory discipline, which is exactly the discipline most undergraduate C and C++ assignments are trying to teach. He moved to tutoring after a sabbatical year, kept the rigor, and dropped the production-fire stress. 980+ CSHH assignments and six years later, students still get the trading-desk debugger workflow whether they asked for it or not.
His specialty is the class of bugs that students cannot reproduce in their own debugger. Segfaults that only appear with optimization enabled. Heap corruption that surfaces three function calls after the actual overrun. Race conditions in pthreads code that pass 99 times and fail the hundredth on the autograder. He keeps a documented Valgrind workflow for each: --tool=memcheck with --track-origins=yes for use-after-free, --tool=helgrind for the thread race, --tool=cachegrind when the question is performance instead of correctness. Students who watch him work the toolchain start to recognize the failure modes by signature.
A representative case from earlier this year. A CS61C student submitted a multi-threaded matrix multiplication that passed all functional tests but ran 40% slower than the staff reference on the performance autograder. The student suspected the OpenMP scheduling. Marcus ran the binary under cachegrind, identified that the inner loop was thrashing the L1 cache because the matrix had been stored row-major and accessed column-major. The fix was eight lines: transpose the second matrix before the multiply, eat the O(n^2) transpose cost to win back O(n^3) cache hits. Score went from 60% to 100% on the next submission. The student understood why because Marcus walked through the cache-miss numbers cachegrind printed line by line.
On the C side his teaching pattern is to make memory ownership explicit before writing any code. Every malloc has a named owner, every owner has a free in the corresponding cleanup path, every function signature documents whether it takes ownership of its arguments or borrows them. Students who learn this discipline stop writing memory leaks because the leak is visible in the function signature before the code runs. C++ students get the same treatment with RAII: every resource is owned by an object, ownership transfers happen at construction or with std::move, and naked new is a code smell that needs justification.
The concurrency work is where most C and C++ students lose their footing. Marcus walks them through a concrete model before any code: shared memory, threads of execution, the happens-before relation, the difference between data race and race condition. Then he picks a textbook bug, a counter incremented from two threads without a mutex, and shows it in three forms. The C source. The compiler-generated assembly with the load, add, store sequence visible. The thread-sanitizer output flagging the race. Students see why the race exists at the instruction level, not just at the C level. The next mutex they write goes in the right place.
His CSHH workflow leans heavily on reproducing the failure before patching it. The brief arrives, he reads the autograder spec first, compiles the student starter code with -Wall -Wextra -Werror -fsanitize=address,undefined, and runs it against the rubric inputs. Bugs that surface under sanitizers but not under a clean compile are almost always the source of the failing test. He sends back a patched solution plus a short writeup explaining what the sanitizer caught and how to read the trace next time. Students who keep the writeup learn to find their own bugs the following week, which is the actual goal of the exercise even when the immediate need is the failing autograder.
Documented Specialties
Malloc/free discipline, valgrind traces.
Unique_ptr, shared_ptr, move semantics.
Mutex, condvar, rwlock, race-condition isolation.
Backtrace, watchpoints, conditional breakpoints.
Marcus handles addresssanitizer and undefinedbehaviorsanitizer interpretation as a recurring CSHH workload, with documented patterns and reference solutions.
Marcus handles cmake build configuration as a recurring CSHH workload, with documented patterns and reference solutions.
Sample Reviewed Code
A representative snippet from Marcus's workflow. Pulled from the diagnostic playbook Marcus runs on incoming CSHH assignments in this language.
// Transpose B before the inner loop so the inner stride hits
// L1 cache lines instead of striding by N. CS61C perf lab: 60% -> 100%.
// Cost: O(n^2) transpose to save O(n^3) cache misses. Net win at n >= 64.
void matmul(const double *A, const double *B, double *C, size_t n) {
double *BT = aligned_alloc(64, n * n * sizeof(double));
for (size_t i = 0; i < n; i++)
for (size_t j = 0; j < n; j++)
BT[j * n + i] = B[i * n + j]; // B^T, row-major
for (size_t i = 0; i < n; i++)
for (size_t j = 0; j < n; j++) {
double acc = 0.0;
for (size_t k = 0; k < n; k++)
acc += A[i * n + k] * BT[j * n + k]; // both sequential
C[i * n + j] = acc;
}
free(BT);
}
Coverage Map
Subjects
Course Matches
CS50 introduces computational thinking across 10 weeks plus a final project, using 4 languages in sequence: Scratch (week 0), C (weeks 1 through 5), Python (weeks 6 through 7),...
10 recurring assignments covered
Get help with CS50MIT 6.006 introduces algorithms across 13 weeks with 26 lectures, 13 recitations, and 7 problem sets. The Spring 2020 redesign by Erik Demaine, Jason Ku, and Justin Solomon...
8 recurring assignments covered
Get help with 6.006CS61B teaches data structures and Java software engineering across 14 weeks under Josh Hug (since 2017) and Justin Yokota (recent semesters). Lectures cover lists, sets, maps,...
8 recurring assignments covered
Get help with CS61BFAQ
More Named Tutors
Four tutors keep public profiles. The rest of the bench stays off the public site so student-tutor matches stay confidential.
MS CS
750+ assignments completed
BS CS
620+ assignments completed
Active Bench
Behind the four named profiles is a wider matching bench. Submissions auto-route by subject, language, and timezone. The public profiles cover the most-requested specializations; the rest of the roster stays unpublished so student-tutor pairings stay private.
Get matched to a tutor
Submit your assignment with Marcus in mind. We will route the request to the best-fit tutor based on subject, language, and current load. Average first reply inside 30 minutes during business hours.
Submit for Marcus