return NULL; /* MEMCACHED_MEMORY_ALLOCATION_FAILURE */
memset(ptr, 0, sizeof(memcached_st));
- ptr->is_allocated= MEMCACHED_ALLOCATED;
+ ptr->is_allocated= true;
}
else
{
ptr->retry_timeout= 0;
ptr->distribution= MEMCACHED_DISTRIBUTION_MODULA;
- ptr->io_msg_watermark = 500;
- ptr->io_bytes_watermark = 65 * 1024;
+ /* TODO, Document why we picked these defaults */
+ ptr->io_msg_watermark= 500;
+ ptr->io_bytes_watermark= 65 * 1024;
return ptr;
}
free(ptr->continuum);
}
- if (ptr->is_allocated == MEMCACHED_ALLOCATED)
+ if (ptr->is_allocated)
{
if (ptr->call_free)
ptr->call_free(ptr, ptr);
free(ptr);
}
else
- ptr->is_allocated= MEMCACHED_USED;
+ memset(ptr, 0, sizeof(memcached_st));
}
/*
if (source == NULL)
return memcached_create(clone);
- if (clone && clone->is_allocated == MEMCACHED_USED)
+ if (clone && clone->is_allocated)
{
return NULL;
}