Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit15db611

Browse files
committed
Fix specifying stack size for thread
1 parentafd818a commit15db611

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
#include"postgres.h"
2020

21+
#include<pthread.h>
2122
#include<unistd.h>
2223
#include<fcntl.h>
2324
#include<sys/param.h>

‎src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4041,7 +4041,7 @@ bool create_thread(pthread_t* t, thread_proc_t thread_proc, void* port)
40414041
}
40424042
ctx->thread_proc=thread_proc;
40434043
pthread_attr_init(&attr);
4044-
pthread_attr_setstacksize(&attr,thread_stack_size);
4044+
pthread_attr_setstacksize(&attr,(size_t)thread_stack_size*1024);
40454045
rc=pthread_create(&ctx->tid,&attr,thread_trampoline,ctx);
40464046
if (rc!=0)elog(WARNING,"pthread_create failed with code %d, errno=%d, thread_stack_size=%d",rc,errno,thread_stack_size);
40474047
*t=ctx->tid;

‎src/backend/utils/mmgr/mcxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ MemoryContextAllocExtended(MemoryContext context, Size size, int flags)
848848
returnret;
849849
}
850850

851-
char*top_strgrab(charconst*str)
851+
char*top_strgrab(char*str)
852852
{
853853
size_tlen=strlen(str)+1;
854854
char*copy=top_malloc(len);

‎src/include/utils/palloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extern void pfree(void *pointer);
9999
#definetop_free(ptr) do if (ptr) pfree(ptr); while(0)
100100
#definetop_strdup(str) MemoryContextStrdup(TopMemoryContext, str)
101101

102-
externchar*top_strgrab(charconst*str);
102+
externchar*top_strgrab(char*str);
103103

104104

105105
/* Higher-limit allocators. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp