From 9c7aa5f3fc007cc3b9b796143ec95076de7f1433 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 19 Oct 2019 18:26:56 -0400 Subject: [PATCH] Attempts also to spot data writes without allocations. --- Outputs/CRT/CRT.cpp | 3 ++- Outputs/CRT/CRT.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Outputs/CRT/CRT.cpp b/Outputs/CRT/CRT.cpp index 5b45513ea..6d2f17f4a 100644 --- a/Outputs/CRT/CRT.cpp +++ b/Outputs/CRT/CRT.cpp @@ -407,7 +407,8 @@ void CRT::set_immediate_default_phase(float phase) { void CRT::output_data(int number_of_cycles, size_t number_of_samples) { #ifndef NDEBUG - assert(number_of_samples <= allocated_data_length_); + assert(number_of_samples > 0 && number_of_samples <= allocated_data_length_); + allocated_data_length_ = std::numeric_limits::min(); #endif scan_target_->end_data(number_of_samples); Scan scan; diff --git a/Outputs/CRT/CRT.hpp b/Outputs/CRT/CRT.hpp index dd5985444..1982e378b 100644 --- a/Outputs/CRT/CRT.hpp +++ b/Outputs/CRT/CRT.hpp @@ -10,6 +10,7 @@ #define CRT_hpp #include +#include #include #include "../ScanTarget.hpp" @@ -84,7 +85,7 @@ class CRT { static const uint8_t DefaultAmplitude = 80; #ifndef NDEBUG - size_t allocated_data_length_ = 0; + size_t allocated_data_length_ = std::numeric_limits::min(); #endif public: