Replace some uses of malloc/free with std::unique_ptr#1069
Replace some uses of malloc/free with std::unique_ptr#1069kmurray merged 3 commits intoverilog-to-routing:masterfrom
Conversation
Signed-off-by: Dustin DeWeese <dustin.deweese@gmail.com>
|
Maybe |
Signed-off-by: Dustin DeWeese <dustin.deweese@gmail.com>
|
Looks like this is failing on valgrind test? |
Signed-off-by: Dustin DeWeese <dustin.deweese@gmail.com>
c42038f to
4ff2a67
Compare
|
I couldn't convert the heap to use vtr-verilog-to-routing/vpr/src/route/route_common.cpp Lines 470 to 472 in 4ff2a67 The right thing to do is probably to use a |
I agree, unless we have a particular reason otherwise using a std::vector makes sense. There should not be any overhead with the regular operator[] on a vector, as it doesn't do bounds checking (only |
|
I'll try replacing the malloc'ed heap with a std::vector, but I'd like to do that in another PR. |
As in, merge this PR and do the vector conversion in a follow up PR? Or just a new PR? Either way seems reasonable to me. |
|
The first option. I'd like to keep the PRs small.
…On Thu, Feb 6, 2020, 12:22 PM kmurray ***@***.***> wrote:
I'll try replacing the malloc'ed heap with a std::vector, but I'd like to
do that in another PR.
As in, merge this PR and do the vector conversion in a follow up PR? Or
just a new PR? Either way seems reasonable to me.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1069?email_source=notifications&email_token=AAIFDFWX3546E7PWVOY6IDTRBRWRFA5CNFSM4J5UTKJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELAUXDI#issuecomment-583093133>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIFDFT3KVA26ETHM5LHC7LRBRWRFANCNFSM4J5UTKJA>
.
|
|
Sounds good, thanks! |
Description
malloc()andfree()can be error-prone, so I'm working on replacing them with safer alternatives, but without adding overhead.Related Issue
#506
Motivation and Context
See issue above.
How Has This Been Tested?
I've run
vtr_reg_strongtests.Types of changes
Checklist: