diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-05-25 07:55:44 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-05-25 07:55:44 +0000 |
commit | ece914761160ed83f41e826443f96a5513eb2744 (patch) | |
tree | 2fa01adc0cd0dd6c632ab31490d72d244095b1cb /src/pugixml.hpp | |
parent | 4e05568c4d6c2fb987a3a01020e3d450f891784e (diff) |
Changed memory management so that the document node lives inside document; this way a default-constructed document does not allocate any dynamic memory
git-svn-id: http://pugixml.googlecode.com/svn/trunk@445 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.hpp')
-rw-r--r-- | src/pugixml.hpp | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 9cdad19..7523079 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -131,13 +131,6 @@ namespace pugi // Parsing options
/**
- * Memory page size, used for fast allocator. Memory for DOM tree is allocated in pages of
- * xml_memory_page_size + size of header (approximately 64 bytes)
- * This value affects size of xml_memory_page class.
- */
- const size_t xml_memory_page_size = 32768;
-
- /**
* Minimal parsing mode. Equivalent to turning all other flags off. This set of flags means
* that pugixml does not add pi/cdata sections or comments to DOM tree and does not perform
* any conversions for input data, meaning fastest parsing.
@@ -329,8 +322,6 @@ namespace pugi struct xml_attribute_struct;
struct xml_node_struct;
- struct xml_allocator;
-
class xml_node_iterator;
class xml_attribute_iterator;
@@ -787,9 +778,6 @@ namespace pugi /// \internal Initializing ctor
explicit xml_node(xml_node_struct* p);
- /// \internal Get allocator
- xml_allocator& get_allocator() const;
-
private:
template <typename OutputIterator> void all_elements_by_name_w_helper(const char_t* name, OutputIterator it) const
{
@@ -1762,24 +1750,6 @@ namespace pugi virtual bool end(xml_node&);
};
- /// \internal Memory page
- struct PUGIXML_CLASS xml_memory_page
- {
- xml_memory_page();
-
- xml_allocator* allocator;
-
- void* memory;
-
- xml_memory_page* prev;
- xml_memory_page* next;
-
- size_t busy_size;
- size_t freed_size;
-
- char data[1];
- };
-
/**
* Struct used to distinguish parsing with ownership transfer from parsing without it.
* \see xml_document::parse
@@ -1847,7 +1817,7 @@ namespace pugi private:
char_t* _buffer;
- xml_memory_page _memory;
+ char _memory[192];
xml_document(const xml_document&);
const xml_document& operator=(const xml_document&);
|