• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision122 (tree)
Time2018-09-10 05:56:53
Authorquiret

Log Message

- fixed a bug where I actually forgot to count in the size of the VMemAllocation header for the initial island spawn, making the next island allocation sometimes fail

Change Summary

Incremental Difference

--- common/sdk/OSUtils.memheap.h (revision 121)
+++ common/sdk/OSUtils.memheap.h (revision 122)
@@ -125,7 +125,7 @@
125125 // actually have to do some good estimate on the maximum required memory size.
126126 // But since the virtual memory pages are allocated at power-of-two offsets the
127127 // estimate should be very good for power-of-two alignments.
128- size_t minSizeByObject = ( offsetToFirstHeaderTryPos + alignedBy + memSize );
128+ size_t minSizeByObject = ( offsetToFirstHeaderTryPos + alignedBy + memSize + sizeof(VMemAllocation) );
129129
130130 size_t actualMinSize = std::max( minSizeByMinPages, minSizeByObject );
131131
--- unittests/src/string.cpp (revision 121)
+++ unittests/src/string.cpp (revision 122)
@@ -86,7 +86,7 @@
8686
8787 // We choose a big enough number to actually trigger a copy...
8888 // Maybe it wont ever copy for you???
89- static constexpr size_t APPEND_COUNT = 40000;
89+ static constexpr size_t APPEND_COUNT = 320000;
9090
9191 for ( size_t n = 0; n < APPEND_COUNT; n++ )
9292 {
@@ -111,6 +111,21 @@
111111 }
112112 printf( "ok.\n" );
113113
114+ printf( "testing string massive insert..." );
115+ {
116+ StringWithHeap string;
117+
118+ static constexpr size_t INSERT_COUNT = 1000;
119+
120+ static const char insert_chars[] = "meow";
121+
122+ for ( size_t n = 0; n < INSERT_COUNT; n++ )
123+ {
124+ string.Insert( n * 3, insert_chars, sizeof(insert_chars) - 1 );
125+ }
126+ }
127+ printf( "ok.\n" );
128+
114129 printf( "testing string move..." );
115130 {
116131 StringWithHeap string1, string2;
Show on old repository browser