pike.git/
src/
stralloc.c
Branch:
Tag:
Non-build tags
All tags
No tags
2005-11-05
2005-11-05 15:28:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>
531730064db5f744ee22c08d677a3c0e5e8b9e4e (
20
lines) (+
10
/-
10
)
[
Show
|
Annotate
]
Branch:
7.9
Fixed a few reference-count bugs introduced by the most recent commits.
Rev: src/stralloc.c:1.202
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: stralloc.c,v 1.
201
2005/11/
03
16
:
19
:
50
grubba Exp $
+
|| $Id: stralloc.c,v 1.
202
2005/11/
05
15
:
28
:
00
grubba Exp $
*/ #include "global.h"
861:
s=begin_shared_string(len); MEMCPY(s->str, str, len); link_pike_string(s, h);
+
} else {
+
add_ref(s);
}
-
add_ref(s);
-
+
return s; }
916:
s=begin_wide_shared_string(len,1); MEMCPY(s->str, str, len<<1); link_pike_string(s, h);
+
} else {
+
add_ref(s);
}
-
add_ref(s);
-
+
return s; }
951:
s=begin_wide_shared_string(len,2); MEMCPY(s->str, str, len<<2); link_pike_string(s, h);
+
} else {
+
add_ref(s);
}
-
add_ref(s);
-
+
return s; }
1699:
add_ref(a = old); } else { link_pike_string(a, a->hval);
-
add_ref(a);
+
} }else{ a = end_shared_string(a);
1834:
if(!str->len) {
-
add_ref(
str
);
-
return
str
;
+
add_ref(
empty_pike_string
);
+
return
empty_pike_string
;
} shift=MAXIMUM(str->size_shift,to->size_shift);