summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/src/memory
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-02 21:01:38 +0100
commitf7d30133221896638f7bf4f66c504255c4b14f48 (patch)
tree5f3e07a049f388a3a309a615b8884318f6668a98 /nsprpub/pr/src/memory
parent26b297510a11758727438df4669357a2a2bc42ce (diff)
downloadUXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.gz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.lz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.tar.xz
UXP-f7d30133221896638f7bf4f66c504255c4b14f48.zip
Issue #1338 - Part 1: Update NSPR to 4.24
Diffstat (limited to 'nsprpub/pr/src/memory')
-rw-r--r--nsprpub/pr/src/memory/prseg.c26
-rw-r--r--nsprpub/pr/src/memory/prshm.c54
-rw-r--r--nsprpub/pr/src/memory/prshma.c22
3 files changed, 53 insertions, 49 deletions
diff --git a/nsprpub/pr/src/memory/prseg.c b/nsprpub/pr/src/memory/prseg.c
index ecad1d0ca..0b70f2d4e 100644
--- a/nsprpub/pr/src/memory/prseg.c
+++ b/nsprpub/pr/src/memory/prseg.c
@@ -18,7 +18,7 @@ void _PR_InitSegs(void)
void _PR_InitSegs(void)
{
- _PR_MD_INIT_SEGS();
+ _PR_MD_INIT_SEGS();
}
/*
@@ -31,20 +31,20 @@ PRSegment* _PR_NewSegment(PRUint32 size, void *vaddr)
{
PRSegment *seg;
- /* calloc the data structure for the segment */
+ /* calloc the data structure for the segment */
seg = PR_NEWZAP(PRSegment);
if (seg) {
- size = ((size + _pr_pageSize - 1) >> _pr_pageShift) << _pr_pageShift;
- /*
- ** Now, allocate the actual segment memory (or map under some OS)
- ** The OS specific code decides from where or how to allocate memory.
- */
- if (_PR_MD_ALLOC_SEGMENT(seg, size, vaddr) != PR_SUCCESS) {
- PR_DELETE(seg);
- return NULL;
- }
- }
+ size = ((size + _pr_pageSize - 1) >> _pr_pageShift) << _pr_pageShift;
+ /*
+ ** Now, allocate the actual segment memory (or map under some OS)
+ ** The OS specific code decides from where or how to allocate memory.
+ */
+ if (_PR_MD_ALLOC_SEGMENT(seg, size, vaddr) != PR_SUCCESS) {
+ PR_DELETE(seg);
+ return NULL;
+ }
+ }
return seg;
}
@@ -54,7 +54,7 @@ PRSegment* _PR_NewSegment(PRUint32 size, void *vaddr)
*/
void _PR_DestroySegment(PRSegment *seg)
{
- _PR_MD_FREE_SEGMENT(seg);
+ _PR_MD_FREE_SEGMENT(seg);
PR_DELETE(seg);
}
diff --git a/nsprpub/pr/src/memory/prshm.c b/nsprpub/pr/src/memory/prshm.c
index 59237e6e7..7a587cd5d 100644
--- a/nsprpub/pr/src/memory/prshm.c
+++ b/nsprpub/pr/src/memory/prshm.c
@@ -20,39 +20,39 @@ extern PRLogModuleInfo *_pr_shm_lm;
/* Posix implementation is in pr/src/md/unix/uxshm.c */
#elif defined PR_HAVE_WIN32_NAMED_SHARED_MEMORY
/* Win32 implementation is in pr/src/md/windows/w32shm.c */
-#else
-/*
-** there is no named_shared_memory
+#else
+/*
+** there is no named_shared_memory
*/
extern PRSharedMemory* _MD_OpenSharedMemory( const char *name, PRSize size, PRIntn flags, PRIntn mode )
{
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return NULL;
-}
+}
extern void * _MD_AttachSharedMemory( PRSharedMemory *shm, PRIntn flags )
{
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return NULL;
-}
+}
extern PRStatus _MD_DetachSharedMemory( PRSharedMemory *shm, void *addr )
{
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE;
-}
+}
extern PRStatus _MD_CloseSharedMemory( PRSharedMemory *shm )
{
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE;
-}
+}
extern PRStatus _MD_DeleteSharedMemory( const char *name )
{
PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
return PR_FAILURE;
-}
+}
#endif /* HAVE_SYSV_NAMED_SHARED_MEMORY */
/*
@@ -60,14 +60,16 @@ extern PRStatus _MD_DeleteSharedMemory( const char *name )
**
*/
PR_IMPLEMENT( PRSharedMemory * )
- PR_OpenSharedMemory(
- const char *name,
- PRSize size,
- PRIntn flags,
- PRIntn mode
+PR_OpenSharedMemory(
+ const char *name,
+ PRSize size,
+ PRIntn flags,
+ PRIntn mode
)
{
- if (!_pr_initialized) _PR_ImplicitInitialization();
+ if (!_pr_initialized) {
+ _PR_ImplicitInitialization();
+ }
return( _PR_MD_OPEN_SHARED_MEMORY( name, size, flags, mode ));
} /* end PR_OpenSharedMemory() */
@@ -76,9 +78,9 @@ PR_IMPLEMENT( PRSharedMemory * )
**
*/
PR_IMPLEMENT( void * )
- PR_AttachSharedMemory(
- PRSharedMemory *shm,
- PRIntn flags
+PR_AttachSharedMemory(
+ PRSharedMemory *shm,
+ PRIntn flags
)
{
return( _PR_MD_ATTACH_SHARED_MEMORY( shm, flags ));
@@ -89,9 +91,9 @@ PR_IMPLEMENT( void * )
**
*/
PR_IMPLEMENT( PRStatus )
- PR_DetachSharedMemory(
- PRSharedMemory *shm,
- void *addr
+PR_DetachSharedMemory(
+ PRSharedMemory *shm,
+ void *addr
)
{
return( _PR_MD_DETACH_SHARED_MEMORY( shm, addr ));
@@ -102,8 +104,8 @@ PR_IMPLEMENT( PRStatus )
**
*/
PR_IMPLEMENT( PRStatus )
- PR_CloseSharedMemory(
- PRSharedMemory *shm
+PR_CloseSharedMemory(
+ PRSharedMemory *shm
)
{
return( _PR_MD_CLOSE_SHARED_MEMORY( shm ));
@@ -114,11 +116,13 @@ PR_IMPLEMENT( PRStatus )
**
*/
PR_EXTERN( PRStatus )
- PR_DeleteSharedMemory(
- const char *name
+PR_DeleteSharedMemory(
+ const char *name
)
{
- if (!_pr_initialized) _PR_ImplicitInitialization();
+ if (!_pr_initialized) {
+ _PR_ImplicitInitialization();
+ }
return(_PR_MD_DELETE_SHARED_MEMORY( name ));
} /* end PR_DestroySharedMemory() */
/* end prshm.c */
diff --git a/nsprpub/pr/src/memory/prshma.c b/nsprpub/pr/src/memory/prshma.c
index c73d7ec16..830b6df51 100644
--- a/nsprpub/pr/src/memory/prshma.c
+++ b/nsprpub/pr/src/memory/prshma.c
@@ -6,7 +6,7 @@
/*
** prshma.h -- NSPR Anonymous Shared Memory
**
-**
+**
*/
#include "primpl.h"
@@ -42,7 +42,7 @@ extern PRFileMap * _PR_MD_IMPORT_FILE_MAP_FROM_STRING(const char *fmstring)
PR_IMPLEMENT(PRFileMap*)
PR_OpenAnonFileMap(
const char *dirName,
- PRSize size,
+ PRSize size,
PRFileMapProtect prot
)
{
@@ -50,21 +50,21 @@ PR_OpenAnonFileMap(
} /* end PR_OpenAnonFileMap() */
/*
-** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export
+** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export
** to my children processes via PR_CreateProcess()
**
**
*/
-PR_IMPLEMENT( PRStatus)
-PR_ProcessAttrSetInheritableFileMap(
+PR_IMPLEMENT( PRStatus)
+PR_ProcessAttrSetInheritableFileMap(
PRProcessAttr *attr,
- PRFileMap *fm,
+ PRFileMap *fm,
const char *shmname
)
{
PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
return( PR_FAILURE);
-} /* end PR_ProcessAttrSetInheritableFileMap() */
+} /* end PR_ProcessAttrSetInheritableFileMap() */
/*
** PR_GetInheritedFileMap() -- Import a PRFileMap previously exported
@@ -72,8 +72,8 @@ PR_ProcessAttrSetInheritableFileMap(
**
*/
PR_IMPLEMENT( PRFileMap *)
-PR_GetInheritedFileMap(
- const char *shmname
+PR_GetInheritedFileMap(
+ const char *shmname
)
{
PRFileMap *fm = NULL;
@@ -86,7 +86,7 @@ PR_GetInheritedFileMap(
**
*/
PR_IMPLEMENT( PRStatus )
-PR_ExportFileMapAsString(
+PR_ExportFileMapAsString(
PRFileMap *fm,
PRSize bufSize,
char *buf
@@ -101,7 +101,7 @@ PR_ExportFileMapAsString(
**
*/
PR_IMPLEMENT( PRFileMap * )
-PR_ImportFileMapFromString(
+PR_ImportFileMapFromString(
const char *fmstring
)
{