aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/dsm_impl.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2013-10-28 12:12:06 -0400
committerRobert Haas <rhaas@postgresql.org>2013-10-28 12:12:06 -0400
commitd2aecaea15556f9986759f3455609bcafb0a3992 (patch)
treeb9c3a567a9d93b8922d85d75a0b06e909bc31d43 /src/backend/storage/ipc/dsm_impl.c
parentc737a2e5641a324d3987750b73928c481a5254a0 (diff)
downloadpostgresql-d2aecaea15556f9986759f3455609bcafb0a3992.tar.gz
postgresql-d2aecaea15556f9986759f3455609bcafb0a3992.zip
Modify dynamic shared memory code to use Size rather than uint64.
This is more consistent with what we do elsewhere.
Diffstat (limited to 'src/backend/storage/ipc/dsm_impl.c')
-rw-r--r--src/backend/storage/ipc/dsm_impl.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c
index 627f00b7fd9..2056668ae99 100644
--- a/src/backend/storage/ipc/dsm_impl.c
+++ b/src/backend/storage/ipc/dsm_impl.c
@@ -69,24 +69,24 @@
#include "utils/memutils.h"
#ifdef USE_DSM_POSIX
-static bool dsm_impl_posix(dsm_op op, dsm_handle handle, uint64 request_size,
+static bool dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
void **impl_private, void **mapped_address,
- uint64 *mapped_size, int elevel);
+ Size *mapped_size, int elevel);
#endif
#ifdef USE_DSM_SYSV
-static bool dsm_impl_sysv(dsm_op op, dsm_handle handle, uint64 request_size,
+static bool dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size,
void **impl_private, void **mapped_address,
- uint64 *mapped_size, int elevel);
+ Size *mapped_size, int elevel);
#endif
#ifdef USE_DSM_WINDOWS
-static bool dsm_impl_windows(dsm_op op, dsm_handle handle, uint64 request_size,
+static bool dsm_impl_windows(dsm_op op, dsm_handle handle, Size request_size,
void **impl_private, void **mapped_address,
- uint64 *mapped_size, int elevel);
+ Size *mapped_size, int elevel);
#endif
#ifdef USE_DSM_MMAP
-static bool dsm_impl_mmap(dsm_op op, dsm_handle handle, uint64 request_size,
+static bool dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
void **impl_private, void **mapped_address,
- uint64 *mapped_size, int elevel);
+ Size *mapped_size, int elevel);
#endif
static int errcode_for_dynamic_shared_memory(void);
@@ -156,19 +156,14 @@ int dynamic_shared_memory_type;
*-----
*/
bool
-dsm_impl_op(dsm_op op, dsm_handle handle, uint64 request_size,
- void **impl_private, void **mapped_address, uint64 *mapped_size,
+dsm_impl_op(dsm_op op, dsm_handle handle, Size request_size,
+ void **impl_private, void **mapped_address, Size *mapped_size,
int elevel)
{
Assert(op == DSM_OP_CREATE || op == DSM_OP_RESIZE || request_size == 0);
Assert((op != DSM_OP_CREATE && op != DSM_OP_ATTACH) ||
(*mapped_address == NULL && *mapped_size == 0));
- if (request_size > (size_t) -1)
- ereport(ERROR,
- (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
- errmsg("requested shared memory size overflows size_t")));
-
switch (dynamic_shared_memory_type)
{
#ifdef USE_DSM_POSIX
@@ -241,8 +236,8 @@ dsm_impl_can_resize(void)
* a different shared memory implementation.
*/
static bool
-dsm_impl_posix(dsm_op op, dsm_handle handle, uint64 request_size,
- void **impl_private, void **mapped_address, uint64 *mapped_size,
+dsm_impl_posix(dsm_op op, dsm_handle handle, Size request_size,
+ void **impl_private, void **mapped_address, Size *mapped_size,
int elevel)
{
char name[64];
@@ -407,8 +402,8 @@ dsm_impl_posix(dsm_op op, dsm_handle handle, uint64 request_size,
* those are not supported everywhere.
*/
static bool
-dsm_impl_sysv(dsm_op op, dsm_handle handle, uint64 request_size,
- void **impl_private, void **mapped_address, uint64 *mapped_size,
+dsm_impl_sysv(dsm_op op, dsm_handle handle, Size request_size,
+ void **impl_private, void **mapped_address, Size *mapped_size,
int elevel)
{
key_t key;
@@ -612,9 +607,9 @@ dsm_impl_sysv(dsm_op op, dsm_handle handle, uint64 request_size,
* when the process containing the reference exits.
*/
static bool
-dsm_impl_windows(dsm_op op, dsm_handle handle, uint64 request_size,
+dsm_impl_windows(dsm_op op, dsm_handle handle, Size request_size,
void **impl_private, void **mapped_address,
- uint64 *mapped_size, int elevel)
+ Size *mapped_size, int elevel)
{
char *address;
HANDLE hmap;
@@ -780,8 +775,8 @@ dsm_impl_windows(dsm_op op, dsm_handle handle, uint64 request_size,
* directory to a ramdisk to avoid this problem, if available.
*/
static bool
-dsm_impl_mmap(dsm_op op, dsm_handle handle, uint64 request_size,
- void **impl_private, void **mapped_address, uint64 *mapped_size,
+dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
+ void **impl_private, void **mapped_address, Size *mapped_size,
int elevel)
{
char name[64];
@@ -892,7 +887,7 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, uint64 request_size,
*/
while (success && remaining > 0)
{
- uint64 goal = remaining;
+ Size goal = remaining;
if (goal > ZBUFFER_SIZE)
goal = ZBUFFER_SIZE;