Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-22653

Configuration modernisation - remove manual memory management

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Minor
    • 5.0.0
    • .master
    • couchbase-bucket

    Description

      The Configuration class still makes use of manual memory management - for example in Configuration::parseConfiguration():

      bool Configuration::parseConfiguration(const char *str,
                                             SERVER_HANDLE_V1* sapi) {
          std::vector<ConfigItem *> config;
       
          std::map<std::string, value_t>::const_iterator iter;
          for (iter = attributes.begin(); iter != attributes.end(); ++iter) {
              config.push_back(new ConfigItem(iter->first.c_str(),
                                              iter->second.datatype));
          }
       
          // we don't have a good support for alias yet...
          config.push_back(new ConfigItem("cache_size", DT_SIZE));
          ... 
      

      This should be replaced with smart (owning) pointers - unique_ptr in this case.

      Attachments

        For Gerrit Dashboard: MB-22653
        # Subject Branch Project Status CR V

        Activity

          People

            premkumar.thangamani Premkumar Thangamani (Inactive)
            drigby Dave Rigby (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty