Stefan Fuhrmann wrote on Tue, Aug 25, 2015 at 22:08:05 +0100: > On Tue, Aug 25, 2015 at 3:23 PM, Branko Čibej <br...@wandisco.com> wrote: > > > On 25.08.2015 14:10, Branko Čibej wrote: > > All right, so I figured that the difference is that apr_array_make does > > two allocations compared to one in this code. Still: relying on > > knowledge of APR implementation details is a really bad idea. > > > The structure definition of apr_array_header_t is part of > the public API, i.e. will never change.
Counter-argument: the struct type is documented as "opaque" and the API has a constructor/allocator for it. Our API has several structs whose definitions are public but consumers are required to call an API to allocate them; perhaps apr_array_header_t uses that pattern too.