PointCloudLibrary / PointCloudLibrary/pcl

[feature] Modernise manual memory management in `range_image_border_extractor`

Open
#3,801 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

effort: medium kind: todo module: features status: stale
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

Context

Manual memory management can be replaced by automatic management providing better move and copy semantics.

Expected behavior

Please tell us how the situation should be instead

Describe the solution you'd like

Replacing the pointers to pointers with something like std::vector<T> or std::unique_ptr<T>, where T is std::unique_ptr<U> or U* or U[].

LocalSurface** surface_structure_;
PointCloudOut* border_descriptions_;
ShadowBorderIndices** shadow_border_informations_;
Eigen::Vector3f** border_directions_;

There are other such opportunities in this class.

unique_ptr

Keeps ABI, beneficial for constant size arrays (runtime allocated)

vector

Might fit usage semantics better (eg: resizing), breaks ABI

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the range_image_border_extractor class and its uses of surface_structure_, border_descriptions_, shadow_border_informations_, and border_directions_. Review how these members are allocated, copied, moved, resized, and destroyed, then determine whether unique_ptr or vector fits each use while preserving ABI where required. Done means the class no longer relies on the identified manual pointer management and its existing behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.