Commit MetaInfo
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
| | @@ -125,7 +125,7 @@ | 125 | 125 | // actually have to do some good estimate on the maximum required memory size.
| 126 | 126 | // But since the virtual memory pages are allocated at power-of-two offsets the
| 127 | 127 | // 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) );
| 129 | 129 |
| 130 | 130 | size_t actualMinSize = std::max( minSizeByMinPages, minSizeByObject );
| 131 | 131 |
|
| | @@ -86,7 +86,7 @@ | 86 | 86 |
| 87 | 87 | // We choose a big enough number to actually trigger a copy...
| 88 | 88 | // Maybe it wont ever copy for you???
| 89 | | - static constexpr size_t APPEND_COUNT = 40000;
| | 89 | + static constexpr size_t APPEND_COUNT = 320000;
| 90 | 90 |
| 91 | 91 | for ( size_t n = 0; n < APPEND_COUNT; n++ )
| 92 | 92 | {
|
| | @@ -111,6 +111,21 @@ | 111 | 111 | }
| 112 | 112 | printf( "ok.\n" );
| 113 | 113 |
| | 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 | +
| 114 | 129 | printf( "testing string move..." );
| 115 | 130 | {
| 116 | 131 | StringWithHeap string1, string2;
|
Show on old repository browser
|