Pointer Wars 2025: Week 1 Code Repository is Live

Pointer Wars: Linked List Edition

The Week 1 repository is now live on Github! There’s still time to join, cost is $25, link here.

This Week’s Tasks

The task for this week is to implement all of the functions declared in linked_list.h and have them pass all of the functional tests in the provided functional test suite. Once that is complete, send us an email with either your code attached, or a GitHub repository that we can clone and test, for code feedback and performance results. I am not going to release what functions are tested and how (as a forcing function to make sure all your code is well written), but upon seeing a performance report it should be obvious.

There are three C structures in linked_list.h: linked_list, node, and iterator. The linked_list is composed of nodes, and the iterator structure is used by a few functions, namely linked_list_iterate(). This function is going to be heavily tested for performance, as sequential access of a list is a common operation.

In terms of memory allocation and deallocation, your library depends on user-specified malloc() and free() functions, registered via the linked_list_register_malloc() and linked_list_register_free() functions. See the malloc_fptr and free_fptr function pointer variables in linked_list.c, which you can use in your implementation of your linked list. One of the reasons for this is code like instrumented_malloc() in linked_list_test_program.c. Another reason is to allow you to specify to me whether you’d like to use a memory allocation library other than libc’s implementation of malloc()/free().

A Note on The Functional Test Suite

As of this writing, I am working on bringing up the performance test infrastructure. I’ve implemented some of the functional tests, not all. Expect me to add functional tests over the next few days (you will be notified via email as I do).

Published by

Leave a comment