-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Description
ngx::core::Pool impls the allocator-api2 Allocator
trait, which makes allocations with &self methods.
However, all of the allocations made through Pool's own impl methods take &mut self
.
In practice, this means that if I have an ngx_pool_t pointer and I have one API that uses the pool via Allocator (e.g. NgxString::new_in
) and another that uses Pool's impl methods directly (e.g. https://github.com/nginx/nginx-acme/blob/main/src/net/resolver.rs#L138), I have to construct two different Pools from the same raw pointer.
I don't think the Allocator
impl is unsound, so I propose the best way to solve this is to downgrade all of Pool's impl methods from &mut self
to &self
.
Metadata
Metadata
Assignees
Labels
No labels