3

The documentation for RapidXml says

Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. Until static memory is exhausted, no dynamic memory allocations are done. When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, by using global new[] and delete[] operators

I interpret this as: RapidXML uses a global memory pool. Are operations on the global memory pool thread safe? I.e. can I use several instances of RapidXML parser throughout my program without having to consider threading issues?

Tobias Furuholm
  • 4,447
  • 3
  • 28
  • 39

1 Answers1

5

My interpretation was wrong. The "static memory pool" is an array that is placed on the stack. It is therefore not static as in C++ static array, but rather static as in "not dynamically allocated".

The conclusion: RapidXML does not share the memory pool between instances. The question is therefore invalid.

Tobias Furuholm
  • 4,447
  • 3
  • 28
  • 39
  • 1
    Thanks for posting the clarification/new NFO rather than just deleting. :) –  Jan 24 '12 at 14:00