Coder Social home page Coder Social logo

Comments (2)

eboasson avatar eboasson commented on June 30, 2024

@rotu you have sharp eyes! As long as the caller dutifully frees the memory all is well, but I never really looked into the details of how the result of deserialization is handled, other than in returning it to the caller of rmw_take. I simply followed the example Fast-RTPS's dynamic RMW code, assuming that it would get these details correct.

A little bit of digging now tells me that this particular case is never used! It is implemented in the eProsima Fast-CDR library with good reason — that's a generic tool for applications to build upon — but this particular use in TypeSupport_impl.h always uses the std::string case.

Deleting the char * case would be best.

There’s a lot of other questionable code in here, including much use of macros where templates would be more appropriate and repeated code.

I agree with that assessment. What I tried originally was classifying types as primitive or not, then have a single templatized one for all primitive ones and handling the few others with special cases, but I got lost in the C++ template error messages. Macros were simply the quickest way to getting something up and running. Now that times have changed, I'm all for cleaning this up.

The best thing would be to rewrite TypeSupport and serdes both. There is quite a bit of code involved in interpreting the ROS type description and some — I would suspect, common — types such as arrays of records of floats involve a significant bit of overhead now. It makes much more sense to preprocess the type to a simpler form that can be interpreted more efficiently.

from rmw_cyclonedds.

rotu avatar rotu commented on June 30, 2024

I agree that a rewrite is in order, and I’ll pitch in with a few PRs.

You may find (as I do) that Clang is tons better than gcc for writing template code. It gives clearer error messages.

from rmw_cyclonedds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.