Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Gzip: avoid unnecessary assignment

Maxim Dounin
August 03, 2014 04:42PM
Hello!

On Fri, Aug 01, 2014 at 08:40:12PM -0700, Piotr Sikora wrote:

> # HG changeset patch
> # User Piotr Sikora <piotr@cloudflare.com>
> # Date 1406950763 25200
> # Fri Aug 01 20:39:23 2014 -0700
> # Node ID 78c35623c5fa444e8ce7a3af5999477a117f79be
> # Parent f87afb46ccd26fccc7ed55ca8a7ef89c6256c3f2
> Gzip: avoid unnecessary assignment.
>
> This change makes it consistent with other custom memory allocators
> provided for zlib.
>
> Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
>
> diff -r f87afb46ccd2 -r 78c35623c5fa src/http/modules/ngx_http_gzip_filter_module.c
> --- a/src/http/modules/ngx_http_gzip_filter_module.c Fri Aug 01 20:04:14 2014 +0900
> +++ b/src/http/modules/ngx_http_gzip_filter_module.c Fri Aug 01 20:39:23 2014 -0700
> @@ -1013,9 +1013,7 @@ ngx_http_gzip_filter_alloc(void *opaque,
> "gzip filter failed to use preallocated memory: %ud of %ud",
> items * size, ctx->allocated);
>
> - p = ngx_palloc(ctx->request->pool, items * size);
> -
> - return p;
> + return ngx_palloc(ctx->request->pool, items * size);
> }

I prefer to keep current code as is. In particular, because it
allows to add debug logging of the address allocated without
additional changes.

--
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] Gzip: avoid unnecessary assignment

Piotr Sikora 710 August 01, 2014 11:42PM

Re: [PATCH] Gzip: avoid unnecessary assignment

Maxim Dounin 397 August 03, 2014 04:42PM



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

Online Users

Guests: 191
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