aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-02 15:52:21 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-02 15:52:21 +0200
commit08392aad8f8e7c5bbcfa010c19786b1f318028b6 (patch)
treebf9c926edf9bd5188f7d019c43a7425073711049 /kernel
parente590ffc84dac1cb1ea833c5e7a71e958b63f7352 (diff)
downloadyosys-08392aad8f8e7c5bbcfa010c19786b1f318028b6.tar.gz
yosys-08392aad8f8e7c5bbcfa010c19786b1f318028b6.tar.bz2
yosys-08392aad8f8e7c5bbcfa010c19786b1f318028b6.zip
Limit size of log_signal buffer to 100 elements
Diffstat (limited to 'kernel')
-rw-r--r--kernel/log.cc7
-rw-r--r--kernel/rtlil.h4
2 files changed, 9 insertions, 2 deletions
diff --git a/kernel/log.cc b/kernel/log.cc
index f67d64c25..9cabc6a83 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -41,6 +41,7 @@ int log_verbose_level;
std::vector<int> header_count;
std::list<std::string> string_buf;
+int string_buf_size = 0;
static struct timeval initial_tv = { 0, 0 };
static bool next_print_log = false;
@@ -166,6 +167,7 @@ void log_pop()
{
header_count.pop_back();
string_buf.clear();
+ string_buf_size = 0;
log_flush();
}
@@ -174,6 +176,7 @@ void log_reset_stack()
while (header_count.size() > 1)
header_count.pop_back();
string_buf.clear();
+ string_buf_size = 0;
log_flush();
}
@@ -197,6 +200,10 @@ const char *log_signal(const RTLIL::SigSpec &sig, bool autoint)
fputc(0, f);
fclose(f);
+ if (string_buf_size < 100)
+ string_buf_size++;
+ else
+ string_buf.pop_front();
string_buf.push_back(ptr);
free(ptr);
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 9430da311..7b989385e 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -74,7 +74,7 @@ namespace RTLIL
struct IdString
{
- // the global string cache
+ // the global id string cache
struct char_ptr_cmp {
bool operator()(const char *a, const char *b) {
@@ -134,7 +134,7 @@ namespace RTLIL
global_free_idx_list_.push_back(idx);
}
- // The actual IdString objects just is a single int
+ // the actual IdString object is just is a single int
int index_;