summaryrefslogtreecommitdiff
path: root/tests/allocator.cpp
AgeCommit message (Collapse)Author
2015-07-25tests: Fix test allocator to provide fundamental alignmentArseny Kapoulkine
Previously test allocator only guaranteed alignment enough for a pointer. On some platforms (e.g. SPARC) double has to be aligned to 8 bytes but pointers can have a size of 4 bytes. This commit increases allocation header to fix that. In practical terms the allocation header is now always 8 bytes.
2015-07-25tests: Only enable page heap on x86/x64Arseny Kapoulkine
This fixes tests in PUGIXML_NO_XPATH mode on SPARC64 (#48). SPARC does not allow unaligned accesses - e.g. you can't read an unaligned int. Normally pugixml does not perform unaligned integer/pointer accesses, but page heap can allocate blocks that are not aligned so that we can detect a single- byte read/write overrun. Additionally, the hardcoded page size we're currently using is really system specific - on SPARC the page size can be 8 Kb instead of 4 Kb so mprotect can fail.
2015-05-12tests: Fix address sanitizer detection for GCCArseny Kapoulkine
2015-05-12tests: Disable page allocator if address sanitizer is activeArseny Kapoulkine
Address sanitizer can detect underflows so we don't really need the custom allocator. Additionally, custom allocator can return memory that is not pointer-aligned; this causes undefined behavior sanitizer to complain.
2015-04-15tests: Fix Linux buildArseny Kapoulkine
2015-04-15tests: Use malloc for OSX/Linux page heapArseny Kapoulkine
Switch to malloc and manually aligning the pointer to the page boundary. mmap is much slower than malloc; this change makes tests ~4x faster.
2015-03-21tests: Fix test compilationArseny Kapoulkine
Rename PAGE_SIZE to page_size to avoid define conflict with Android SDK. Minor fixes in several tests.
2015-03-01tests: Implement page heap for OSX/LinuxArseny Kapoulkine
Align allocations to right end of page boundary to catch buffer overruns, instead of unmapping on deallocations mark the page as no-access to guarantee a page fault on use-after-free.
2014-10-21tests: Assert on out-of-memory in testsArseny Kapoulkine
This should never happen but can improve debugging experience for work-in-progress changes since that avoids memcpy() into negative memory space (debugger can't backtrace from failed memcpy since it does not set up the stack frame). git-svn-id: https://pugixml.googlecode.com/svn/trunk@1070 99668b35-9821-0410-8761-19e4c4f06640
2014-10-01tests: Fix allocator.cpp indentationArseny Kapoulkine
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1030 99668b35-9821-0410-8761-19e4c4f06640
2012-02-19tests: Minor fixes for WinCE compilationarseny.kapoulkine@gmail.com
git-svn-id: http://pugixml.googlecode.com/svn/trunk@834 99668b35-9821-0410-8761-19e4c4f06640
2010-12-19Enabled many additional GCC warnings (most notably -Wshadow and ↵arseny.kapoulkine
-Wold-style-cast), fixed the code accordingly git-svn-id: http://pugixml.googlecode.com/svn/trunk@800 99668b35-9821-0410-8761-19e4c4f06640
2010-08-30tests: Custom allocations now use memory from Win32 heap instead of CRT heaparseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@711 99668b35-9821-0410-8761-19e4c4f06640
2010-08-03tests: Reduce address space pressure of test allocatorarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@623 99668b35-9821-0410-8761-19e4c4f06640
2010-07-19Set svn:eol-style to native for all text filesarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@607 99668b35-9821-0410-8761-19e4c4f06640
2010-07-15tests: Added Xbox360 and PS3 toolset supportarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@602 99668b35-9821-0410-8761-19e4c4f06640
2010-05-06Integrated changes from unicode branch to trunkarseny.kapoulkine
git-svn-id: http://pugixml.googlecode.com/svn/trunk@383 99668b35-9821-0410-8761-19e4c4f06640