fix negative pstats reporting

This commit is contained in:
David Rose 2007-06-27 17:38:54 +00:00
parent 8c46644a1c
commit 4190c60ba7
2 changed files with 4 additions and 3 deletions

View File

@ -194,6 +194,7 @@ write_data(const unsigned char *data, size_t size, bool compressed) {
PT(VertexDataSaveBlock) block = (VertexDataSaveBlock *)SimpleAllocator::do_alloc(size); PT(VertexDataSaveBlock) block = (VertexDataSaveBlock *)SimpleAllocator::do_alloc(size);
if (block != (VertexDataSaveBlock *)NULL) { if (block != (VertexDataSaveBlock *)NULL) {
_total_file_size = max(_total_file_size, block->get_start() + size);
block->set_compressed(compressed); block->set_compressed(compressed);
#ifdef _WIN32 #ifdef _WIN32
@ -240,8 +241,6 @@ write_data(const unsigned char *data, size_t size, bool compressed) {
size -= result; size -= result;
} }
#endif // _WIN32 #endif // _WIN32
_total_file_size = max(_total_file_size, block->get_start() + size);
} }
return block; return block;

View File

@ -44,11 +44,13 @@ public:
size_t max_size); size_t max_size);
~VertexDataSaveFile(); ~VertexDataSaveFile();
PUBLISHED:
INLINE bool is_valid() const; INLINE bool is_valid() const;
INLINE size_t get_total_file_size() const; INLINE size_t get_total_file_size() const;
INLINE size_t get_used_file_size() const; INLINE size_t get_used_file_size() const;
public:
PT(VertexDataSaveBlock) write_data(const unsigned char *data, size_t size, PT(VertexDataSaveBlock) write_data(const unsigned char *data, size_t size,
bool compressed); bool compressed);
bool read_data(unsigned char *data, size_t size, bool read_data(unsigned char *data, size_t size,