MCPcopy Create free account
hub / github.com/LouisBrunner/valgrind-macos / set

Method set

drd/tests/annotate_smart_pointer.cpp:236–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234
235private:
236 void set(T* const pT, counter_t* const count_ptr)
237 {
238 if (m_ptr != pT)
239 {
240 if (m_count_ptr)
241 {
242 if (s_enable_annotations)
243 U_ANNOTATE_HAPPENS_BEFORE(m_count_ptr);
244 if (--(*m_count_ptr) == 0)
245 {
246 if (s_enable_annotations)
247 U_ANNOTATE_HAPPENS_AFTER(m_count_ptr);
248 delete m_ptr;
249 m_ptr = NULL;
250 delete m_count_ptr;
251 m_count_ptr = NULL;
252 }
253 }
254 m_ptr = pT;
255 m_count_ptr = count_ptr;
256 if (count_ptr)
257 ++(*m_count_ptr);
258 }
259 }
260
261 T* m_ptr;
262 counter_t* m_count_ptr;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected