• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision176 (tree)
Time2018-12-26 08:29:55
Authorquiret

Log Message

- fixed remnants of old eIntersectionResult convention
- exported the "RegressToSeekType" function because it is important for the FileSystem module
- minor adjustments (common sense)

Change Summary

Incremental Difference

--- common/sdk/MemoryUtils.h (revision 175)
+++ common/sdk/MemoryUtils.h (revision 176)
@@ -216,9 +216,9 @@
216216 {
217217 const memSlice_t& nextBlockSlice = extItemIter.GetMemorySlice();
218218
219- typename memSlice_t::eIntersectionResult intResult = newBlockSlice.intersectWith( nextBlockSlice );
219+ typename eir::eIntersectionResult intResult = newBlockSlice.intersectWith( nextBlockSlice );
220220
221- if ( memSlice_t::isFloatingIntersect( intResult ) == false )
221+ if ( eir::isFloatingIntersect( intResult ) == false )
222222 return false;
223223 }
224224
--- common/sdk/MemoryUtils.stream.h (revision 175)
+++ common/sdk/MemoryUtils.stream.h (revision 176)
@@ -27,14 +27,10 @@
2727 #include <assert.h>
2828 #endif //_DEBUG
2929
30-// Algorithms-only for performing read and write access on a size-bounded device.
31-template <typename seekNumberType>
32-struct BoundedBufferOperations
30+namespace SeekPointerUtil
3331 {
34-private:
35- typedef sliceOfData <seekNumberType> streamSlice_t;
36-
37- static AINLINE seekNumberType RegressToSeekType( size_t count )
32+ template <typename seekNumberType>
33+ AINLINE seekNumberType RegressToSeekType( size_t count )
3834 {
3935 seekNumberType seekCount;
4036
@@ -53,13 +49,21 @@
5349
5450 return seekCount;
5551 }
52+};
5653
54+// Algorithms-only for performing read and write access on a size-bounded device.
55+template <typename seekNumberType>
56+struct BoundedBufferOperations
57+{
58+private:
59+ typedef sliceOfData <seekNumberType> streamSlice_t;
60+
5761 public:
5862 template <typename managerType>
5963 static AINLINE size_t CalculateWriteCount( seekNumberType currentSeekOffset, seekNumberType streamSize, size_t tryWriteCount, managerType *truncMan )
6064 {
6165 // We must properly transform writeCount into seek-space.
62- seekNumberType seekWriteCount = RegressToSeekType( tryWriteCount );
66+ seekNumberType seekWriteCount = SeekPointerUtil::RegressToSeekType <seekNumberType> ( tryWriteCount );
6367
6468 streamSlice_t writeSlice( currentSeekOffset, seekWriteCount );
6569
@@ -147,7 +151,7 @@
147151 static AINLINE size_t CalculateReadCount( seekNumberType currentSeekOffset, seekNumberType streamSize, size_t tryReadCount )
148152 {
149153 // Transform number into seek space.
150- seekNumberType seekReadCount = RegressToSeekType( tryReadCount );
154+ seekNumberType seekReadCount = SeekPointerUtil::RegressToSeekType <seekNumberType> ( tryReadCount );
151155
152156 // Check read slice against file slice.
153157 streamSlice_t readSlice( currentSeekOffset, seekReadCount );
--- common/sdk/SortedSliceSector.h (revision 175)
+++ common/sdk/SortedSliceSector.h (revision 176)
@@ -150,6 +150,10 @@
150150 template <typename... constrArgs>
151151 AINLINE void Insert( sectorSlice_t slice, constrArgs... args )
152152 {
153+ // We are not going to insert empty slices.
154+ if ( slice.IsEmpty() )
155+ return;
156+
153157 // Check if our request would overlap with anything.
154158 // If it would then we have to merge instead.
155159 AVLNode *avlBeginMergeWithNode = this->data.avlSliceTree.FindMinimumNodeByCriteria(
Show on old repository browser