ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/dynbuf.h
(Generate patch)

Comparing deliantra/server/include/dynbuf.h (file contents):
Revision 1.7 by root, Thu May 3 09:26:45 2007 UTC vs.
Revision 1.8 by root, Sat May 26 15:44:03 2007 UTC

2#define DYNBUF_H__ 2#define DYNBUF_H__
3 3
4#include <cstring> 4#include <cstring>
5#include <cassert> 5#include <cassert>
6 6
7#include "util.h"
7#include "shstr.h" 8#include "shstr.h"
8 9
9// this is a "buffer" that can grow fast 10// this is a "buffer" that can grow fast
10// and is still somewhat space-efficient. 11// and is still somewhat space-efficient.
11// unlike obstacks or other data structures, 12// unlike obstacks or other data structures,
47 48
48 int room () const { return end - ptr; } 49 int room () const { return end - ptr; }
49 50
50 char *force (int size) 51 char *force (int size)
51 { 52 {
52 if (ptr + size >= end) 53 if (expect_false (ptr + size >= end))
53 _reserve (size); 54 _reserve (size);
54 55
55 return ptr; 56 return ptr;
56 } 57 }
57 58

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines