SDS: changes to unify Redis SDS with antirez/sds repo.

This commit is contained in:
antirez
2015-07-25 17:25:44 +02:00
parent 9894495c5a
commit cb2782c314
4 changed files with 75 additions and 27 deletions

View File

@ -33,6 +33,13 @@
static void setProtocolError(redisClient *c, int pos);
/* Return the size consumed from the allocator, for the specified SDS string,
* including internal fragmentation. This function is used in order to compute
* the client output buffer size. */
size_t sdsZmallocSize(sds s) {
void *sh = sdsAllocPtr(s);
return zmalloc_size(sh);
}
/* Return the amount of memory used by the sds string at object->ptr
* for a string object. */