[postgis-devel] C-Library function returning PostGIS point crashing backend

Sandro Santilli strk at keybit.net
Mon Jan 21 02:46:28 PST 2013


On Fri, Jan 18, 2013 at 01:47:31PM -0500, David Fuhry wrote:

> What did work was imitating libpgcommon/lwgeom_pg.c and defining my own
> pg_alloc etc., then having lwgeom_init_allocators assign lwalloc_var =
> pg_alloc; and likewise for the others. strk I think you were right about
> allocation using malloc and deallocation using pfree because the
> implementation of lwgeom_install_default_allocators (in lwutil.c)
> sets lwalloc_var = default_allocator; and default_allocator uses malloc.
> 
> Thanks for the help, all. Working code is attached.

Good news. Maybe you could now see if the _new_ API gets simpler for you ?
Also I'd be curious to know _why_ deallocation was using pfree.

With the new API the absence of an explicit call to the handlers
registration function should result in default handlers being used
(expecting malloc/free).

--strk;




More information about the postgis-devel mailing list