1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-04-10 07:39:01 +00:00

Attempts also to spot data writes without allocations.

This commit is contained in:
Thomas Harte 2019-10-19 18:26:56 -04:00
parent 418cd07e17
commit 9c7aa5f3fc
2 changed files with 4 additions and 2 deletions
Outputs/CRT

@ -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<size_t>::min();
#endif
scan_target_->end_data(number_of_samples);
Scan scan;

@ -10,6 +10,7 @@
#define CRT_hpp
#include <cstdint>
#include <limits>
#include <memory>
#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<size_t>::min();
#endif
public: