1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-21 10:42:50 +03:00

On Windows, we know the backend stack size limit because we have to

specify it explicitly in backend/Makefile.  Arrange for this value to
be known by get_stack_depth_rlimit() too.  Per suggestion from Magnus.
This commit is contained in:
Tom Lane
2006-10-08 17:15:34 +00:00
parent 5e0bc3b711
commit c7611f99d6
4 changed files with 16 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
#
# Copyright (c) 1994, Regents of the University of California
#
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.119 2006/09/09 03:15:40 tgl Exp $
# $PostgreSQL: pgsql/src/backend/Makefile,v 1.120 2006/10/08 17:15:33 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -52,7 +52,7 @@ postgres: $(OBJS) postgres.def libpostgres.a
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack,4194304 -o $@$(X) $@.exp $(OBJS) $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack,$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(OBJS) $(LIBS)
rm -f $@.exp $@.base
postgres.def: $(OBJS)
@@ -69,7 +69,7 @@ postgres: $(OBJS) postgres.def libpostgres.a $(WIN32RES)
$(DLLTOOL) --dllname $@$(X) --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -o $@$(X) -Wl,--base-file,$@.base $@.exp $(OBJS) $(WIN32RES) $(LIBS)
$(DLLTOOL) --dllname $@$(X) --base-file $@.base --output-exp $@.exp --def postgres.def
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack=4194304 -o $@$(X) $@.exp $(OBJS) $(WIN32RES) $(LIBS)
$(CC) $(CFLAGS) $(LDFLAGS) -Wl,--stack=$(WIN32_STACK_RLIMIT) -o $@$(X) $@.exp $(OBJS) $(WIN32RES) $(LIBS)
rm -f $@.exp $@.base
postgres.def: $(OBJS)

View File

@@ -4,7 +4,7 @@
# Makefile for tcop
#
# IDENTIFICATION
# $PostgreSQL: pgsql/src/backend/tcop/Makefile,v 1.25 2003/11/29 19:51:57 pgsql Exp $
# $PostgreSQL: pgsql/src/backend/tcop/Makefile,v 1.26 2006/10/08 17:15:34 tgl Exp $
#
#-------------------------------------------------------------------------
@@ -14,6 +14,8 @@ include $(top_builddir)/src/Makefile.global
OBJS= dest.o fastpath.o postgres.o pquery.o utility.o
override CPPFLAGS += -DWIN32_STACK_RLIMIT=$(WIN32_STACK_RLIMIT)
all: SUBSYS.o
SUBSYS.o: $(OBJS)

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.513 2006/10/07 20:16:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.514 2006/10/08 17:15:34 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -3678,8 +3678,13 @@ get_stack_depth_rlimit(void)
}
return val;
#else /* no getrlimit */
#if defined(WIN32) || defined(__CYGWIN__)
/* On Windows we set the backend stack size in src/backend/Makefile */
return WIN32_STACK_RLIMIT;
#else /* not windows ... give up */
return -1;
#endif
#endif
}