Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
42e2ce6a
Commit
42e2ce6a
authored
Jun 29, 2012
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix confusion between "size" and "AnonymousShmemSize".
Noted by Andres Freund. Also improve a couple of comments.
parent
7a5c9ca9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
src/backend/port/sysv_shmem.c
src/backend/port/sysv_shmem.c
+7
-5
No files found.
src/backend/port/sysv_shmem.c
View file @
42e2ce6a
...
...
@@ -408,13 +408,14 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
long
pagesize
=
sysconf
(
_SC_PAGE_SIZE
);
/*
* Ensure request size is a multiple of pagesize.
*
* pagesize will, for practical purposes, always be a power of two.
* But just in case it isn't, we do it this way instead of using
* TYPEALIGN().
*/
AnonymousShmemSize
=
size
;
if
(
size
%
pagesize
!=
0
)
AnonymousShmemSize
+=
pagesize
-
(
size
%
pagesize
);
if
(
pagesize
>
0
&&
size
%
pagesize
!=
0
)
size
+=
pagesize
-
(
size
%
pagesize
);
/*
* We assume that no one will attempt to run PostgreSQL 9.3 or later
...
...
@@ -435,9 +436,10 @@ PGSharedMemoryCreate(Size size, bool makePrivate, int port)
"%lu bytes), reduce PostgreSQL's shared memory usage, "
"perhaps by reducing shared_buffers or "
"max_connections."
,
(
unsigned
long
)
AnonymousShmemSize
)
:
0
));
(
unsigned
long
)
size
)
:
0
));
AnonymousShmemSize
=
size
;
/* Now we
can allocate a minimal SHM
block. */
/* Now we
need only allocate a minimal-sized SysV shmem
block. */
allocsize
=
sizeof
(
PGShmemHeader
);
}
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment