aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-06-25 21:33:48 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-06-25 21:33:48 +0200
commitdb890d3a81bfe6760e9f4ea981798269abb60a20 (patch)
treeddae875c970642d6b79bb09ae201abe5f280c050 /common/nextpnr.h
parent64208da1f986f104682c9c050c43f2273900810a (diff)
downloadnextpnr-db890d3a81bfe6760e9f4ea981798269abb60a20.tar.gz
nextpnr-db890d3a81bfe6760e9f4ea981798269abb60a20.tar.bz2
nextpnr-db890d3a81bfe6760e9f4ea981798269abb60a20.zip
nets and cells are unique_ptr's
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 71a52758..af1ed733 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -24,6 +24,7 @@
#include <unordered_map>
#include <unordered_set>
#include <vector>
+#include <memory>
#ifndef NEXTPNR_H
#define NEXTPNR_H
@@ -194,8 +195,8 @@ struct BaseCtx
// --------------------------------------------------------------
- std::unordered_map<IdString, NetInfo *> nets;
- std::unordered_map<IdString, CellInfo *> cells;
+ std::unordered_map<IdString, std::unique_ptr<NetInfo>> nets;
+ std::unordered_map<IdString, std::unique_ptr<CellInfo>> cells;
BaseCtx()
{
@@ -210,12 +211,6 @@ struct BaseCtx
~BaseCtx()
{
- for (auto &item : nets) {
- delete item.second;
- }
- for (auto &item : cells) {
- delete item.second;
- }
delete idstring_str_to_idx;
delete idstring_idx_to_str;
}