[Tile-serving] [osm2pgsql] Replace manually allocated strings in middle-pgsql with std::string (#248)

Sarah Hoffmann notifications at github.com
Sun Jan 4 23:26:09 UTC 2015


This removes all the remaining char* that were manually allocated through either malloc or strdup and replaces them with std::string. Namely they are

 * sql commands in the table descriptions
 * buffers for building tag and node lists
 
It fixes another couple of smaller memory leaks (see #228). Note that it also contains a test for #247 which is currently disabled because it fails.

@pnorman would you mind running another round of performance tests with the full planet? It would also be good to have some numbers on osc updates, if your setup permits to do that easily.
You can merge this Pull Request by running:

  git pull https://github.com/lonvia/osm2pgsql stdstring-middle

Or you can view, comment on it, or merge it online at:

  https://github.com/openstreetmap/osm2pgsql/pull/248

-- Commit Summary --

  * replace sql commands in table_desc with std::string
  * use std::string for buffers
  * add tests for reading and writing tag lists in middle
  * move static buffers into middle-pgsql_t class
  * replace remaining malloc'd char* with std::string

-- File Changes --

    M middle-pgsql.cpp (718)
    M middle-pgsql.hpp (69)
    M tests/middle-tests.cpp (31)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/248.patch
https://github.com/openstreetmap/osm2pgsql/pull/248.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/248
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150104/c8606072/attachment.html>


More information about the Tile-serving mailing list