return NULL;
}
- ret= ptr->call_malloc(ptr, (size_t) (length + 1));
+ ret= libmemcached_malloc(ptr, (size_t) (length + 1));
memcpy(ret, buffer, (size_t) length);
ret[length]= '\0';
memcached_stat_st *memcached_stat(memcached_st *ptr, char *args, memcached_return_t *error)
{
- uint32_t x;
memcached_return_t rc;
memcached_stat_st *stats;
return NULL;
}
- stats= ptr->call_calloc(ptr, memcached_server_count(ptr), sizeof(memcached_stat_st));
+ stats= libmemcached_calloc(ptr, memcached_server_count(ptr), sizeof(memcached_stat_st));
- stats->root= ptr;
-
- if (!stats)
+ if (! stats)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
}
rc= MEMCACHED_SUCCESS;
- for (x= 0; x < memcached_server_count(ptr); x++)
+ for (uint32_t x= 0; x < memcached_server_count(ptr); x++)
{
memcached_return_t temp_return;
memcached_server_instance_st *instance;
+ memcached_stat_st *stat_instance;
+
+ stat_instance= stats + x;
+
+ stat_instance->root= ptr;
instance= memcached_server_instance_fetch(ptr, x);
if (ptr->flags.binary_protocol)
{
- temp_return= binary_stats_fetch(stats + x, args, instance);
+ temp_return= binary_stats_fetch(stat_instance, args, instance);
}
else
{
- temp_return= ascii_stats_fetch(stats + x, args, instance);
+ temp_return= ascii_stats_fetch(stat_instance, args, instance);
}
if (temp_return != MEMCACHED_SUCCESS)
We make a copy of the keys since at some point in the not so distant future
we will add support for "found" keys.
*/
-char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_stat,
+char ** memcached_stat_get_keys(memcached_st *ptr,
+ memcached_stat_st *memc_stat,
memcached_return_t *error)
{
- (void) memc_stat;
char **list;
size_t length= sizeof(memcached_stat_keys);
- list= ptr->call_malloc(ptr, length);
+ (void)memc_stat;
+
+ list= libmemcached_malloc(ptr, length);
- if (!list)
+ if (! list)
{
*error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;
return NULL;
if (memc_stat->root)
{
- memc_stat->root->call_free(ptr, memc_stat);
+ libmemcached_free(memc_stat->root, memc_stat);
}
else if (ptr)
{
- ptr->call_free(ptr, memc_stat);
+ libmemcached_free(ptr, memc_stat);
}
else
{