ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/shstr.C
(Generate patch)

Comparing deliantra/server/common/shstr.C (file contents):
Revision 1.17 by root, Tue Sep 12 19:20:06 2006 UTC vs.
Revision 1.18 by root, Tue Sep 12 20:55:40 2006 UTC

10 10
11#include <tr1/unordered_set> 11#include <tr1/unordered_set>
12 12
13#include "global.h" 13#include "global.h"
14 14
15typedef std::tr1::unordered_set<const char *, str_hash, str_equal> HT; 15typedef std::tr1::unordered_set <const char *, str_hash, str_equal, slice_allocator<const char *>, true> HT;
16 16
17static HT ht; 17static HT ht;
18 18
19static const char * 19static const char *
20makevec (const char *s) 20makevec (const char *s)
21{ 21{
22 int len = strlen (s); 22 int len = strlen (s);
23 23
24 const char *v = (const char *) (2 + (int *) g_slice_alloc (sizeof (int) * 2 + len + 1)); 24 const char *v = (const char *) (2 + (int *)g_slice_alloc (sizeof (int) * 2 + len + 1));
25 25
26 shstr::length (v) = len; 26 shstr::length (v) = len;
27 shstr::refcnt (v) = 1; 27 shstr::refcnt (v) = 1;
28 28
29 memcpy ((char *) v, s, len + 1); 29 memcpy ((char *) v, s, len + 1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines