Welcome!
Log In
Create A New Profile
Home
>
Mailing Lists
>
Nginx Mailing List - English
> Topic
Advanced
What is the best way to reallocate memory for char array?
Previous Message
Next Message
Forum List
Message List
New Topic
Print View
kay
November 17, 2014 09:09AM
Registered: 14 years ago
Posts: 48
For example I've allocated memory for char *str:
str = ngx_pnalloc(r->pool, len1);
Then I've added some data to "str":
ngx_sprintf(str, "abc");
How should I reallocate this memory? Should I use:
str = ngx_pnalloc(r->pool, len2);
? And I would like to keep the str's "abc" data as well.
Reply
Quote
RSS
Subject
Author
Posted
What is the best way to reallocate memory for char array?
kay
November 17, 2014 09:09AM
Re: What is the best way to reallocate memory for char array?
kay
November 17, 2014 09:10AM
Re: What is the best way to reallocate memory for char array?
Maxim Dounin
November 17, 2014 09:24AM
Re: What is the best way to reallocate memory for char array?
kay
November 17, 2014 09:35AM
Re: What is the best way to reallocate memory for char array?
Maxim Dounin
November 17, 2014 09:50AM
Sorry, only registered users may post in this forum.
Click here to login
Online Users
anurkuma
Guests: 93
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024