This change allows interrupting any function at allocation time.
Doesn't allow interrupting loops not invoking custom allocators
(includes GEOS, so far).
git-svn-id: http://svn.osgeo.org/postgis/trunk@9715
b70326c6-7e19-0410-871a-
916f4a2858ee
#include <postgres.h>
#include <fmgr.h>
#include <executor/spi.h>
+#include <miscadmin.h>
#include "../postgis_config.h"
#include "liblwgeom.h"
{
void * result;
+ CHECK_FOR_INTERRUPTS(); /* give interrupter a chance */
+
POSTGIS_DEBUGF(5, " pg_alloc(%d) called", (int)size);
result = palloc(size);
{
void * result;
+ CHECK_FOR_INTERRUPTS(); /* give interrupter a chance */
+
POSTGIS_DEBUGF(5, " pg_realloc(%p, %d) called", mem, (int)size);
result = repalloc(mem, size);