Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Style: use ngx_calloc_buf()

Maxim Dounin
August 03, 2014 06:08PM
Hello!

On Sun, Aug 03, 2014 at 01:50:17AM +0900, Tatsuhiko Kubo wrote:

> # HG changeset patch
> # User Tatsuhiko Kubo <cubicdaiya@gmail.com>
> # Date 1406996678 -32400
> # Sun Aug 03 01:24:38 2014 +0900
> # Node ID cca43437e50ab2581e857479b287ceb8c20606a4
> # Parent f87afb46ccd26fccc7ed55ca8a7ef89c6256c3f2
> Style: use ngx_calloc_buf().
>
> diff -r f87afb46ccd2 -r cca43437e50a src/http/modules/ngx_http_flv_module.c
> --- a/src/http/modules/ngx_http_flv_module.c Fri Aug 01 20:04:14 2014 +0900
> +++ b/src/http/modules/ngx_http_flv_module.c Sun Aug 03 01:24:38 2014 +0900
> @@ -203,7 +203,7 @@ ngx_http_flv_handler(ngx_http_request_t
> }
>
> if (i == 0) {
> - b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
> + b = ngx_calloc_buf(r->pool);
> if (b == NULL) {
> return NGX_HTTP_INTERNAL_SERVER_ERROR;
> }

[...]

I don't think that this change is needed. There is almost no
difference between ngx_pcalloc(sizeof(ngx_buf_t)) and
ngx_calloc_buf() even from style point of view, and both are
usable if appropriate.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Style: use ngx_calloc_buf()

cubicdaiya 781 August 02, 2014 12:52PM

Re: [PATCH] Style: use ngx_calloc_buf()

Maxim Dounin 388 August 03, 2014 06:08PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready