aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/memory.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-11-15 21:14:46 +0000
committerBruce Momjian <bruce@momjian.us>2007-11-15 21:14:46 +0000
commitfdf5a5efb7b28c13085fe7313658de8d7b9914f6 (patch)
treea75cf1422fa1eef4e801cf502b148d8ce1b5dfe7 /src/interfaces/ecpg/ecpglib/memory.c
parent3adc760fb92eab1a8720337a8bf9b66486609eb3 (diff)
downloadpostgresql-fdf5a5efb7b28c13085fe7313658de8d7b9914f6.tar.gz
postgresql-fdf5a5efb7b28c13085fe7313658de8d7b9914f6.zip
pgindent run for 8.3.
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/memory.c')
-rw-r--r--src/interfaces/ecpg/ecpglib/memory.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/interfaces/ecpg/ecpglib/memory.c b/src/interfaces/ecpg/ecpglib/memory.c
index cb22a15b75e..63b57177ec2 100644
--- a/src/interfaces/ecpg/ecpglib/memory.c
+++ b/src/interfaces/ecpg/ecpglib/memory.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/memory.c,v 1.11 2007/10/03 11:11:12 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/memory.c,v 1.12 2007/11/15 21:14:45 momjian Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -69,8 +69,8 @@ struct auto_mem
};
#ifdef ENABLE_THREAD_SAFETY
-static pthread_key_t auto_mem_key;
-static pthread_once_t auto_mem_once = PTHREAD_ONCE_INIT;
+static pthread_key_t auto_mem_key;
+static pthread_once_t auto_mem_once = PTHREAD_ONCE_INIT;
static void
auto_mem_destructor(void *arg)
@@ -92,13 +92,13 @@ get_auto_allocs(void)
}
static void
-set_auto_allocs(struct auto_mem *am)
+set_auto_allocs(struct auto_mem * am)
{
pthread_setspecific(auto_mem_key, am);
}
-
#else
-static struct auto_mem *auto_allocs = NULL;
+static struct auto_mem *auto_allocs = NULL;
+
#define get_auto_allocs() (auto_allocs)
#define set_auto_allocs(am) do { auto_allocs = (am); } while(0)
#endif
@@ -124,10 +124,11 @@ ECPGfree_auto_mem(void)
do
{
struct auto_mem *act = am;
+
am = am->next;
ecpg_free(act->pointer);
ecpg_free(act);
- } while(am);
+ } while (am);
set_auto_allocs(NULL);
}
}
@@ -143,9 +144,10 @@ ecpg_clear_auto_mem(void)
do
{
struct auto_mem *act = am;
+
am = am->next;
ecpg_free(act);
- } while(am);
+ } while (am);
set_auto_allocs(NULL);
}
}