summaryrefslogtreecommitdiff
path: root/tests/t_vector.c
AgeCommit message (Collapse)Author
3 daysUnify the peerlists for v4 and v6Dirk Engling
This commit finishes what started with unifying v4 and v6 trackers, from then on, torrents carried a peer list per family, with obvious redundancies. With the race to save memory, these became burdening enough that now these peerlist pointers have been moved into a single struct, holding both v4 and v6 peers in their respective ot_vectors, so the per- torrent cost shrunk by another pointer's size. Each peerlist also lost its peer count cache, as in most cases, it's trivial to load it directly from the ot_vector's entry count. The seed counts that were kept per family only to be aggregated later for every consumer, are also merged now. Total savings depend on the tracker's actual load. In some corner cases, where only one address family dominates the torrents, we actually use a few bytes more in the ot_vector for the absent family, but even that mostly becomes noise: before it actually adds to the memory load, the peer payload will be the deciding factor. Most wins are on what often is experienced on trackers: A long tail of abandoned torrents now needs eight fewer bytes, slipping into a smaller allocation unit on glibc's allocator.
8 daysSweep the obsolete CVS Id keyword out of the treeDirk Engling
2026-10-26Avoid an UB of adding NULL + 0 by keeping an offset instead of advancing the pointer into a vector structDirk Engling
2026-10-26First run of making variable names more readableDirk Engling
2026-10-25Clean up peer re-distribution between single bucket vectors and bucket lists, add testsDirk Engling
2026-10-24Add a unit test harness and a first set of testsDirk Engling
make check builds tests/runner from the modules that link without the io subsystem and runs it.