Skip to content

Commit

Permalink
refs #6449 win32 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts authored and martyngigg committed Apr 10, 2013
1 parent a51d597 commit 847dd8a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/DiskBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <stdint.h>
#include <vector>
#include <list>
#include <limits>

namespace Mantid
{
Expand Down Expand Up @@ -99,8 +100,10 @@ namespace Kernel
* @param buffer :: number of events to accumulate before writing. 0 to NOT use the write buffer */
void setWriteBufferSize(uint64_t buffer)
{
m_writeBufferSize = buffer;
//m_useWriteBuffer = (buffer > 0);
if(buffer>std::numeric_limits<size_t>::max()/2)
throw std::runtime_error(" Can not aloocate memory for that many events on given architecture ");

m_writeBufferSize = static_cast<size_t>(buffer);
}

/// @return the size of the to-write buffer, in number of events
Expand Down

0 comments on commit 847dd8a

Please sign in to comment.