projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Added srcdir includes so that the include files could be found in vpath builds.
[m6w6/libmemcached]
/
libmemcached
/
memcached_string.c
diff --git
a/libmemcached/memcached_string.c
b/libmemcached/memcached_string.c
index 3cc894d52c9ff55426cf3d5a368fd2175b59232b..5a6f190e5dd9f1fdbd526df01afffc991b1ce280 100644
(file)
--- a/
libmemcached/memcached_string.c
+++ b/
libmemcached/memcached_string.c
@@
-41,10
+41,7
@@
memcached_string_st *memcached_string_create(memcached_st *ptr, memcached_string
/* Saving malloc calls :) */
if (string)
/* Saving malloc calls :) */
if (string)
- {
memset(string, 0, sizeof(memcached_string_st));
memset(string, 0, sizeof(memcached_string_st));
- string->is_allocated= MEMCACHED_NOT_ALLOCATED;
- }
else
{
if (ptr->call_malloc)
else
{
if (ptr->call_malloc)
@@
-55,7
+52,7
@@
memcached_string_st *memcached_string_create(memcached_st *ptr, memcached_string
if (string == NULL)
return NULL;
memset(string, 0, sizeof(memcached_string_st));
if (string == NULL)
return NULL;
memset(string, 0, sizeof(memcached_string_st));
- string->is_allocated=
MEMCACHED_ALLOCATED
;
+ string->is_allocated=
true
;
}
string->block_size= MEMCACHED_BLOCK_SIZE;
string->root= ptr;
}
string->block_size= MEMCACHED_BLOCK_SIZE;
string->root= ptr;
@@
-81,8
+78,6
@@
memcached_return memcached_string_append_character(memcached_string_st *string,
{
memcached_return rc;
{
memcached_return rc;
- WATCHPOINT_ASSERT(string->is_allocated != MEMCACHED_USED);
-
rc= memcached_string_check(string, 1);
if (rc != MEMCACHED_SUCCESS)
rc= memcached_string_check(string, 1);
if (rc != MEMCACHED_SUCCESS)
@@
-99,8
+94,6
@@
memcached_return memcached_string_append(memcached_string_st *string,
{
memcached_return rc;
{
memcached_return rc;
- WATCHPOINT_ASSERT(string->is_allocated != MEMCACHED_USED);
-
rc= memcached_string_check(string, length);
if (rc != MEMCACHED_SUCCESS)
rc= memcached_string_check(string, length);
if (rc != MEMCACHED_SUCCESS)
@@
-120,8
+113,6
@@
char *memcached_string_c_copy(memcached_string_st *string)
{
char *c_ptr;
{
char *c_ptr;
- WATCHPOINT_ASSERT(string->is_allocated != MEMCACHED_USED);
-
if (memcached_string_length(string) == 0)
return NULL;
if (memcached_string_length(string) == 0)
return NULL;
@@
-141,7
+132,6
@@
char *memcached_string_c_copy(memcached_string_st *string)
memcached_return memcached_string_reset(memcached_string_st *string)
{
memcached_return memcached_string_reset(memcached_string_st *string)
{
- WATCHPOINT_ASSERT(string->is_allocated != MEMCACHED_USED);
string->end= string->string;
return MEMCACHED_SUCCESS;
string->end= string->string;
return MEMCACHED_SUCCESS;
@@
-160,7
+150,7
@@
void memcached_string_free(memcached_string_st *ptr)
free(ptr->string);
}
free(ptr->string);
}
- if (ptr->is_allocated
== MEMCACHED_ALLOCATED
)
+ if (ptr->is_allocated)
{
if (ptr->root->call_free)
ptr->root->call_free(ptr->root, ptr);
{
if (ptr->root->call_free)
ptr->root->call_free(ptr->root, ptr);
@@
-168,5
+158,5
@@
void memcached_string_free(memcached_string_st *ptr)
free(ptr);
}
else
free(ptr);
}
else
-
ptr->is_allocated= MEMCACHED_USED
;
+
memset(ptr, 0, sizeof(memcached_string_st))
;
}
}