Welcome! Log In Create A New Profile

Advanced

Nginx allocates directive names from cycle pool

Sambhav Gupta via nginx-devel
September 10, 2024 04:52AM
Hi Nginx experts,

While reviewing the Nginx source code, I noticed that during the conf file parsing, directive names are allocated from the cycle pool.
For instance:
ssl_certificate /path/to/cert/file;

It makes sense to allocate the directive's argument (e.g., the file path) from a pool that persists for the lifetime of the cycle, as modules generally don't clone these arguments but store them directly in their respective confs.
However, wouldn't it be more efficient to allocate the directive name itself from a temporary pool, one that only lives during the configuration parsing process? Since the directive name is only needed for comparison against the module's command array, it seems unnecessary for it to persist for the entire cycle.

I'd appreciate any insights or thoughts on this approach.

Best regards,
Sambhav

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

Nginx allocates directive names from cycle pool

Sambhav Gupta via nginx-devel 47 September 10, 2024 04:52AM



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

Online Users

Guests: 132
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready