summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_string.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-06-20 19:49:17 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-06-20 19:49:17 +0300
commitf888a5310c1808902b4035ca3454b62bc5cf4434 (patch)
tree7425e11cdba27420d21468b0f79787834bd3c498 /src/nxt_string.c
parentc7ab908c19242a5ddd0233e123e8c2be210b3c02 (diff)
downloadunit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.gz
unit-f888a5310c1808902b4035ca3454b62bc5cf4434.tar.bz2
Using new memory pool implementation.
Diffstat (limited to 'src/nxt_string.c')
-rw-r--r--src/nxt_string.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nxt_string.c b/src/nxt_string.c
index 7e9d8fd4..79dfe72d 100644
--- a/src/nxt_string.c
+++ b/src/nxt_string.c
@@ -8,12 +8,12 @@
nxt_str_t *
-nxt_str_alloc(nxt_mem_pool_t *mp, size_t length)
+nxt_str_alloc(nxt_mp_t *mp, size_t length)
{
nxt_str_t *s;
/* The string start is allocated aligned to be close to nxt_str_t. */
- s = nxt_mem_alloc(mp, sizeof(nxt_str_t) + length);
+ s = nxt_mp_get(mp, sizeof(nxt_str_t) + length);
if (nxt_fast_path(s != NULL)) {
s->length = length;
@@ -31,13 +31,13 @@ nxt_str_alloc(nxt_mem_pool_t *mp, size_t length)
*/
nxt_str_t *
-nxt_str_dup(nxt_mem_pool_t *mp, nxt_str_t *dst, const nxt_str_t *src)
+nxt_str_dup(nxt_mp_t *mp, nxt_str_t *dst, const nxt_str_t *src)
{
u_char *p;
if (dst == NULL) {
/* The string start is allocated aligned to be close to nxt_str_t. */
- dst = nxt_mem_alloc(mp, sizeof(nxt_str_t) + src->length);
+ dst = nxt_mp_get(mp, sizeof(nxt_str_t) + src->length);
if (nxt_slow_path(dst == NULL)) {
return NULL;
}
@@ -47,7 +47,7 @@ nxt_str_dup(nxt_mem_pool_t *mp, nxt_str_t *dst, const nxt_str_t *src)
dst->start = p;
} else {
- dst->start = nxt_mem_nalloc(mp, src->length);
+ dst->start = nxt_mp_nget(mp, src->length);
if (nxt_slow_path(dst->start == NULL)) {
return NULL;
}
@@ -69,11 +69,11 @@ nxt_str_dup(nxt_mem_pool_t *mp, nxt_str_t *dst, const nxt_str_t *src)
*/
char *
-nxt_str_copy(nxt_mem_pool_t *mp, const nxt_str_t *src)
+nxt_str_copy(nxt_mp_t *mp, const nxt_str_t *src)
{
char *p, *dst;
- dst = nxt_mem_align(mp, 2, src->length + 1);
+ dst = nxt_mp_align(mp, 2, src->length + 1);
if (nxt_fast_path(dst != NULL)) {
p = nxt_cpymem(dst, src->start, src->length);