mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
sdsnative() removed: New rdb.c API can load native strings.
This commit is contained in:
parent
f699b5e801
commit
32b10004e2
11
src/sds.c
11
src/sds.c
@ -88,17 +88,6 @@ void sdsfree(sds s) {
|
||||
zfree(s-sizeof(struct sdshdr));
|
||||
}
|
||||
|
||||
/* Remove sds header so we can use buffer as malloc'd byte array.
|
||||
* Returns the contents of 's' usable as a full malloc'd C string. */
|
||||
char *sdsnative(sds s) {
|
||||
if (!s) return NULL;
|
||||
|
||||
size_t len = sdslen(s);
|
||||
char *base = s-sizeof(struct sdshdr);
|
||||
memmove(base, s, len);
|
||||
return zrealloc(base, len);
|
||||
}
|
||||
|
||||
/* Set the sds string length to the length as obtained with strlen(), so
|
||||
* considering as content only up to the first null term character.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user