Thread (73 messages) 73 messages, 4 authors, 2024-07-02

Re: [PATCH 01/11] t: move reftable/record_test.c to the unit testing framework

From: Han-Wen Nienhuys <hidden>
Date: 2024-06-26 14:24:48

On Wed, Jun 26, 2024 at 1:52 PM Karthik Nayak [off-list ref] wrote:
But to summarize, seems like we're not sure why this was added. CC'ing
Han-Wen here incase he remembers the intent.
The copy functions are like C++ copy constructors. They discard the
old data, and copy over the new data into the destination.

If we forget to free() something in the "discard old data" step, that
would be exercised by initializing the record to hold data (1st copy
call) and then triggering the cleanup (2nd copy call.). Valgrind or
similar tooling would then detect the leak.

-- 
Han-Wen Nienhuys - hanwenn@gmail.com - http://www.xs4all.nl/~hanwen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help