Project

General

Profile

Cleanup #1314

Replace widespread dynamic allocated arrays with std::vector

Added by Phil Miller about 2 years ago. Updated 6 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
11/28/2016
Due date:
% Done:

0%


Description

There are loads of places in the runtime system and our examples where the code manually allocates an array member using malloc or new. This results in the potential for leaked memory, and really ugly cumbersome code in PUP methods that have to use the if (p.isUnpacking()) foo = new T[n] idiom. All of this goes away if those members are just defined as std::vector<T>

History

#1 Updated by Sam White about 2 years ago

Most places that deal with strings (esp. where we deal with files: checkpoint/restart, tracing, etc.) currently use char* or char[arbitrary_max_len], which can be cleaned up by using std::string too.

#2 Updated by Sam White about 1 year ago

Cleanup ckreduction.C: https://charm.cs.illinois.edu/gerrit/#/c/3234/
Cleanup the rest of ck-core (except CkSectionID, which looks more involved): https://charm.cs.illinois.edu/gerrit/#/c/3239/

The biggest offenders for this bug are ck-perf and ck-ldb.

#3 Updated by Sam White about 1 year ago

We should also replace all uses of CkVec with std::vector.

Edit: we've made some progress on this, but ck-ldb, ck-perf, and all the examples & tests remain to be done:

replace CkVec usage in xlat-i: with std::vector https://charm.cs.illinois.edu/gerrit/#/c/charm/+/3273/
replace CkVec usage in conv-* with std::vector: https://charm.cs.illinois.edu/gerrit/#/c/charm/+/3274/
ck-cp: https://charm.cs.illinois.edu/gerrit/#/c/charm/+/3275/
ck-core: https://charm.cs.illinois.edu/gerrit/#/c/charm/+/3337/

#4 Updated by Eric Bohm 4 months ago

  • Assignee set to Evan Ramos

#5 Updated by Evan Ramos 3 months ago

  • Target version changed from Unscheduled to 6.9.1

#6 Updated by Evan Ramos 6 days ago

  • Target version changed from 6.9.1 to 6.10.0

Also available in: Atom PDF