Skip to content

Commit

Permalink
Don't create Histogram object if no entries (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
furuame authored Mar 16, 2023
1 parent 4033e18 commit 8d04103
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sparta/sparta/resources/Array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ namespace sparta
// to work as the underlying implementation structures of our array.
array_.reset(static_cast<ArrayPosition *>(malloc(sizeof(ArrayPosition) * num_entries_)));

if(statset)
if((num_entries > 0) && statset)
{
utilization_.reset(new CycleHistogramStandalone(statset, clk,
name + "_utilization",
Expand Down
2 changes: 1 addition & 1 deletion sparta/sparta/resources/Buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ namespace sparta
num_entries_(num_entries),
data_pool_size_(num_entries* 2)
{
if(statset)
if((num_entries > 0) && statset)
{
utilization_.reset(new CycleHistogramStandalone(statset, clk_,
name_ + "_utilization",
Expand Down
2 changes: 1 addition & 1 deletion sparta/sparta/resources/Queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ namespace sparta
collector_(nullptr)
{

if(statset)
if((num_entries > 0) && statset)
{
utilization_.reset(new CycleHistogramStandalone(statset, clk,
name + "_utilization",
Expand Down

0 comments on commit 8d04103

Please sign in to comment.