Age | Commit message (Collapse) | Author |
|
Now compact_string matches compact_pointer_parent.
Turns out PUGI__UNLIKELY is good at reordering conditions but usually does not
really affect performance. Since MSVC should treat "if" branches as taken and
does not support branch probabilities, don't use them if we don't need to.
|
|
|
|
Instead of checking if the object being removed allocated a marker, mark the
marker block as deleted immediately upon allocation. This simplifies the logic
and prevents extra markers from being inserted if we allocate/deallocate the
same node indefinitely.
Also change marker pointer type to uint32_t*.
|
|
First assignment uses a fast path; second assignment uses a specialized
path as well.
|
|
|
|
When we deallocate nodes/attributes that allocated the marker we have to
adjust the size accordingly, and dismiss the marker in case it gets
overwritten with something else...
|
|
Header is now just 2 bytes, with optional additonal 4 bytes that are only
allocated for every 85 nodes / 128 attributes.
|
|
|
|
|
|
This temporarily increases the node size to 16 bytes - we'll bring it back.
It allows us to remove the horrible node_pi hack and to reduce the amount of
changes against master. This comes at the price of not decreasing basline
xml_node_struct size.
The compact xml_node_struct is also increased by this change but a followup
change will reduce *both* xml_attribute_struct and xml_node_struct (to 8/12
bytes).
|
|
The memory_large_allocations test sometimes classified hash allocations
as page allocations since hash table could reach 512 entries.
|
|
Split a long line into multiple statements.
|
|
Also remove useless comments.
|
|
|
|
|
|
We used this in two cases - to get the page pointer and to test flags.
We now use PUGI__GETPAGE for getting the page pointer and operator& to test
flags - this makes getting node type significantly faster since it does not
require page pointer reconstruction.
|
|
|
|
|
|
Clarify the offset applied when encoding the pointer difference.
Make decoding diff slightly more clear - no effect on performance.
Adjust branch weighting in compact_string encoding - 0.5% faster.
Use uint16_t in compact_pointer_parent - 2% faster.
|
|
Make sure compact_hash_table::rehash() is not inlined - that way reserve() is
inlined so the fast path has no extra function calls.
Also use subtraction instead of multiplication when checking capacity.
|
|
|
|
|
|
|
|
|
|
|
|
Also test ranged for and copying big xpath_variable_set objects (to make
sure we actually handle hash collisions properly)
|
|
xpath_query, xpath_node_set and xpath_variable_set are now moveable.
This is a nice performance optimization for variable/node sets, and enables
storing xpath_query in containers without using pointers (it's only possible
now since the query is not copyable).
|
|
|
|
xpath_variable_set is essentially an associative container; it's about time it
became copyable.
Implementation is slightly tricky due to out of memory handling. Both copy ctor
and assignment operator have strong exception guarantee (even if exceptions are
disabled! which translates to "roll back on allocation errors").
|
|
|
|
Switch to malloc and manually aligning the pointer to the page boundary.
mmap is much slower than malloc; this change makes tests ~4x faster.
|
|
The type of the variable is now initialized correctly in the ctor, so that there
is no interim invalid state.
|
|
Since the type of the set was updated before assignment, assigning in
out-of-memory condition could change the type to not match the content.
|
|
If xml_writer::write throws an exception while being called from flush(), the
exception is thrown from destructor. Clang in C++11 mode calls std::terminate
in this case.
|
|
Slightly reword format_indent description.
|
|
Fix code style and revert redundant parameters/whitespace changes.
Also remove format_each_attribute_on_new_line - we're only introducing one
extra formatting flag. The flag implies format_indent but does not include its
bitmask.
Also add a few more tests.
Fixes #14.
|
|
git://github.com/halex2005/pugixml into indent_attributes
|
|
|
|
|
|
|
|
End of an era.
Make can be used for regular development (Linux/OSX), documentation building
and release packaging.
CMake can be used for regular development (Windows); it's also used by some
Linux distributions.
Continuous integration is now performed by Travis CI and AppVeyor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Also fix test in wchar_t mode.
|
|
Ensure that all the necessary cleanup is performed in case the allocation fails
with an exception - files are closed, buffers are reclaimed, etc.
Any test that triggers a simulated out-of-memory condition is ran once again
with a throwing allocation function. Unobserved std::bad_alloc count as test
failures and require CHECK_ALLOC_FAIL macro.
Fixes #17.
|
|
Also add tests that verify save_file for absence of FILE leaks.
|