vrpRouting  0.3
pgr_alloc.cpp File Reference
#include "c_common/pgr_alloc.hpp"
#include <cstring>
#include <string>
Include dependency graph for pgr_alloc.cpp:

Go to the source code of this file.

Functions

char * pgr_msg (const std::string &msg)
 

Function Documentation

◆ pgr_msg()

char* pgr_msg ( const std::string &  msg)

Definition at line 33 of file pgr_alloc.cpp.

33  {
34  char* duplicate = nullptr;
35  duplicate = pgr_alloc(msg.size() + 1, duplicate);
36  memcpy(duplicate, msg.c_str(), msg.size());
37  duplicate[msg.size()] = '\0';
38  return duplicate;
39 }

References pgr_alloc().

Referenced by do_compatibleVehicles(), do_optimize(), do_pgr_pickDeliver(), do_pgr_pickDeliverEuclidean(), do_pickDeliver(), and do_vrp_vroom().

pgr_alloc
T * pgr_alloc(std::size_t size, T *ptr)
allocates memory
Definition: pgr_alloc.hpp:66