Exemple #1
0
 /** declare intent to write
     @param ofs offset within buf at which we will write
     @param len the length at ofs we will write
     @return new buffer pointer.  this is modified when testIntent is true.
 */
 void* DurableImpl::writingAtOffset(void *buf, unsigned ofs, unsigned len) {
     char *p = (char *) buf;
     if( testIntent )
         p = (char *) MongoMMF::switchToPrivateView(buf);
     declareWriteIntent(p+ofs, len);
     return p;
 }
Exemple #2
0
 void* DurableImpl::writingPtr(void *x, unsigned len) { 
     void *p = x;
     if( testIntent )
         p = MongoMMF::switchToPrivateView(x);
     declareWriteIntent(p, len);
     return p;
 }
Exemple #3
0
 void* DurableImpl::writingRangesAtOffsets(void *buf, const vector< pair< long long, unsigned > > &ranges ) {
     char *p = (char *) buf;
     for( vector< pair< long long, unsigned > >::const_iterator i = ranges.begin();
             i != ranges.end(); ++i ) {
         declareWriteIntent( p + i->first, i->second );
     }
     return p;
 }
Exemple #4
0
 /** declare intent to write
     @param ofs offset within buf at which we will write
     @param len the length at ofs we will write
     @return new buffer pointer.
 */
 void* DurableImpl::writingAtOffset(void *buf, unsigned ofs, unsigned len) {
     char *p = (char *) buf;
     declareWriteIntent(p+ofs, len);
     return p;
 }
Exemple #5
0
 void* DurableImpl::writingPtr(void *x, unsigned len) {
     dassert(shutdownRequested.load() == 0);
     void *p = x;
     declareWriteIntent(p, len);
     return p;
 }