Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f5629902
Commit
f5629902
authored
Jan 07, 2015
by
antirez
Browse files
sdsnative() removed: New rdb.c API can load native strings.
parent
0760c1f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/sds.c
View file @
f5629902
...
@@ -88,17 +88,6 @@ void sdsfree(sds s) {
...
@@ -88,17 +88,6 @@ void sdsfree(sds s) {
zfree
(
s
-
sizeof
(
struct
sdshdr
));
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
/* Set the sds string length to the length as obtained with strlen(), so
* considering as content only up to the first null term character.
* considering as content only up to the first null term character.
*
*
...
...
src/sds.h
View file @
f5629902
...
@@ -60,7 +60,6 @@ sds sdsempty(void);
...
@@ -60,7 +60,6 @@ sds sdsempty(void);
size_t
sdslen
(
const
sds
s
);
size_t
sdslen
(
const
sds
s
);
sds
sdsdup
(
const
sds
s
);
sds
sdsdup
(
const
sds
s
);
void
sdsfree
(
sds
s
);
void
sdsfree
(
sds
s
);
char
*
sdsnative
(
sds
s
);
size_t
sdsavail
(
const
sds
s
);
size_t
sdsavail
(
const
sds
s
);
sds
sdsgrowzero
(
sds
s
,
size_t
len
);
sds
sdsgrowzero
(
sds
s
,
size_t
len
);
sds
sdscatlen
(
sds
s
,
const
void
*
t
,
size_t
len
);
sds
sdscatlen
(
sds
s
,
const
void
*
t
,
size_t
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment