citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 43eef2864a1dd55abcef89b10e4aa6f7744a53d0
parent 38f44ce9313a6ea88067dbd5f6aa498674a58714
Author: Kyle Milz <kyle@0x30.net>
Date:   Sat, 17 Dec 2016 21:48:09 -0700

src: use vector instead of new

Diffstat:
Msrc/gl_transunit.cc | 4++--
Msrc/gl_transunit.h | 2+-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gl_transunit.cc b/src/gl_transunit.cc @@ -31,7 +31,7 @@ GlTranslationUnit::GlTranslationUnit(void* &mem, demo_font_t *font, glyphy_point_t &cur_pos) : m_node(static_cast<struct citrun_node *>(mem)), m_data((unsigned long long *)(m_node + 1)), - m_data_buffer(new uint64_t[m_node->size]()) + m_data_buffer(m_node->size) { unsigned int size, page_mask; @@ -104,7 +104,7 @@ GlTranslationUnit::get_extents() void GlTranslationUnit::save_executions() { - std::memcpy(m_data_buffer, m_data, m_node->size * sizeof(unsigned long long)); + std::memcpy(&m_data_buffer[0], m_data, m_node->size * sizeof(unsigned long long)); } void diff --git a/src/gl_transunit.h b/src/gl_transunit.h @@ -11,7 +11,7 @@ class GlTranslationUnit { struct citrun_node *m_node; uint64_t *m_data; - uint64_t *m_data_buffer; + std::vector<uint64_t> m_data_buffer; GlBuffer m_glbuffer; public: