Forum: NGINX Life of objects allocated using the request pool?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Adarsh Pugalia (Guest)
on 2014-06-11 08:56
(Received via mailing list)
What is the life of objects allocated using the request pool? If I
allocate
memory from the r->pool in a request handler, what would be the life of
the
object? Will the objects be freed if the request is over of will it
sustain
over multiple requests?
Maxim Dounin (Guest)
on 2014-06-12 00:07
(Received via mailing list)
Hello!

On Wed, Jun 11, 2014 at 12:26:03PM +0530, Adarsh Pugalia wrote:

> What is the life of objects allocated using the request pool? If I allocate
> memory from the r->pool in a request handler, what would be the life of the
> object? Will the objects be freed if the request is over of will it sustain
> over multiple requests?

The request pool is destroyed with the request, and no objects
allocated from the pool can be used after this.

That's actually the whole point: allocations from a pool don't need
to be freed individually, it's enough to destroy the pool itself.

--
Maxim Dounin
http://nginx.org/
This topic is locked and can not be replied to.