Project

General

Profile

Actions

Task #3687

closed

Reduce usage of shared_ptr in NameTree

Added by Junxiao Shi over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tables
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
6.00 h

Description

In NameTree and name tree entry API, change shared_ptr parameters to constant or mutable reference parameters, wherever it's feasible.


Related issues 1 (0 open1 closed)

Related to NFD - Task #3164: Reduce usage of shared_ptr in FIB/PIT/StrategyChoice/MeasurementsClosedJunxiao Shi

Actions
Actions #1

Updated by Junxiao Shi over 7 years ago

  • Related to Task #3164: Reduce usage of shared_ptr in FIB/PIT/StrategyChoice/Measurements added
Actions #2

Updated by Junxiao Shi over 7 years ago

  • Status changed from New to In Progress
Actions #3

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 0 to 10

https://gerrit.named-data.net/2980 corrects code style in NameTree and name tree entry.

I intentionally keep "refactoring" minimal, and avoid moving code up and down.

Actions #4

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 10 to 40

https://gerrit.named-data.net/3015 refactors NameTree iterator in preparation for shared_ptr changes.

All existing test cases are passing.

Actions #5

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/3017 refactors NameTree hashtable to make it a separate component.

patchset1 has the API only. I will wait for reviews on the API before proceeding further.

Actions #6

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/3017 patchset2 has partial implementation of NameTree hashtable.
I haven't converted iterator part; to avoid conflicts, I won't do that until https://gerrit.named-data.net/3015 is approved.

Actions #7

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 40 to 60

https://gerrit.named-data.net/3017 patchset3 completes hashtable refactoring, but I'll add more test cases.

Actions #8

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/3017 patchset5 adds test cases for hashtable.

Actions #9

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 60 to 70

https://gerrit.named-data.net/3049 patchset2 deletes functions deprecated in previous two commits, and improves Doxygen.

https://gerrit.named-data.net/3050 patchset3 changes return type of findExactMatch and findLongestPrefixMatch to Entry*.

Actions #10

Updated by Junxiao Shi over 7 years ago

  • % Done changed from 70 to 80

https://gerrit.named-data.net/3058 ensures NameTree::lookup(tableEntry) to have "find or insert" semantics equivalent to Name::lookup(Name).
It handles special cases such as Fib::s_emptyEntry and PIT entry ending with digest attached on one-shorter-prefix.

Prior usages of NameTree::lookup(tableEntry) have been replaced with NameTree::getEntry if insertion is undesired.

https://gerrit.named-data.net/3059 changes the return type of NameTree::lookup from shared_ptr<Entry> to Entry&.

Actions #11

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/3064 simplifies Fib::findLongestPrefixMatch and StrategyChoice::findEffectiveStrategy.

https://gerrit.named-data.net/3065 deletes unnecessary name_tree::Iterator destructor.
It was introduced when I initially designed the iterator to be a base class, and full/partial/all-match have iterator subclasses; that idea didn't work, but I forgot to delete the destructor.

Actions #12

Updated by Junxiao Shi over 7 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 80 to 100

https://gerrit.named-data.net/3068 changes cleanupOnFaceRemoval procedure so it doesn't rely on weak_ptr<name_tree::Entry>.

https://gerrit.named-data.net/3069 makes Node the sole owner of Entry. It allocates and deallocates Entry through new and delete.

No shared_ptr<name_tree::Entry> exist after this change.

Actions #13

Updated by Junxiao Shi over 7 years ago

https://gerrit.named-data.net/3069 patchset6 makes Entry a member field of Node to avoid separate memory allocations for Node and Entry.

Actions #14

Updated by Junxiao Shi over 7 years ago

  • Status changed from Code review to Closed
Actions #15

Updated by Junxiao Shi over 7 years ago

  • Status changed from Closed to Feedback

Reopening, because I need to update NFD devguide "NameTree" section.

Actions #16

Updated by Junxiao Shi over 7 years ago

  • Status changed from Feedback to Closed

NFD devguide is updated in nfd-docs:commit:7b3c50490482a82383f4fb2a889978cff4556580

Actions

Also available in: Atom PDF