2c2
< * Copyright (c) 2012-2013 ARM Limited
---
> * Copyright (c) 2012-2013, 2015 ARM Limited
62c62,63
< degree(p->degree)
---
> degree(p->degree),
> pcTable(pcTableAssoc, pcTableSets, name())
67a69
> }
69,73c71,85
< for (int c = 0; c < maxContexts; c++) {
< pcTable[c] = new StrideEntry*[pcTableSets];
< for (int s = 0; s < pcTableSets; s++) {
< pcTable[c][s] = new StrideEntry[pcTableAssoc];
< }
---
> StridePrefetcher::StrideEntry**
> StridePrefetcher::PCTable::allocateNewContext(int context)
> {
> auto res = entries.insert(std::make_pair(context,
> new StrideEntry*[pcTableSets]));
> auto it = res.first;
> chatty_assert(res.second, "Allocating an already created context\n");
> assert(it->first == context);
>
> DPRINTF(HWPrefetch, "Adding context %i with stride entries at %p\n",
> context, it->second);
>
> StrideEntry** entry = it->second;
> for (int s = 0; s < pcTableSets; s++) {
> entry[s] = new StrideEntry[pcTableAssoc];
74a87
> return entry;
77,79c90,91
< StridePrefetcher::~StridePrefetcher()
< {
< for (int c = 0; c < maxContexts; c++) {
---
> StridePrefetcher::PCTable::~PCTable() {
> for (auto entry : entries) {
81c93
< delete[] pcTable[c][s];
---
> delete[] entry.second[s];
82a95
> delete[] entry.second;
101,102d113
< assert(master_id < maxContexts);
<