diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index 4cf11c329c1d..265294c920bb 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_10_2_RTM +NSPR_4_10_3_BETA1 diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index 6c66b37ca0fc..e49e92677e3e 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,4 +10,3 @@ */ #error "Do not include this header file." - diff --git a/nsprpub/configure b/nsprpub/configure index 484a15a7d15f..433790b99319 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -736,7 +736,7 @@ test "$host_alias" != "$target_alias" && MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=10 -MOD_PATCH_VERSION=2 +MOD_PATCH_VERSION=3 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= @@ -3229,6 +3229,8 @@ fi +MOZ_ALIGN=toolchain-default + case "$target" in arm*-android*|arm*-linuxandroid*) MOZ_THUMB=yes @@ -3236,6 +3238,7 @@ arm*-android*|arm*-linuxandroid*) MOZ_FPU=vfp MOZ_FLOAT_ABI=softfp MOZ_SOFT_FLOAT=yes + MOZ_ALIGN=no ;; arm*-*) if test -n "$MOZ_PLATFORM_MAEMO"; then @@ -3338,14 +3341,14 @@ no) _SAVE_CFLAGS="$CFLAGS" CFLAGS="$arch_flag" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* MOZ_THUMB2=1 else @@ -3402,21 +3405,61 @@ no) ;; esac -all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag` +case "$MOZ_ALIGN" in +toolchain-default|"") + align_flag="" + ;; +no) + align_flag="-mno-unaligned-access" + ;; +yes) + align_flag="-munaligned-access" + ;; +*) + align_flag="" + ;; +esac + +if test -n "$align_flag"; then + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $align_flag" + echo $ac_n "checking whether alignment flag ($align_flag) is supported""... $ac_c" 1>&6 +echo "configure:3428: checking whether alignment flag ($align_flag) is supported" >&5 + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + align_flag="" +fi +rm -f conftest* + CFLAGS="$_SAVE_CFLAGS" +fi + +all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag` if test -n "$all_flags"; then _SAVE_CFLAGS="$CFLAGS" CFLAGS="$all_flags" echo $ac_n "checking whether the chosen combination of compiler flags ($all_flags) works""... $ac_c" 1>&6 -echo "configure:3411: checking whether the chosen combination of compiler flags ($all_flags) works" >&5 +echo "configure:3454: checking whether the chosen combination of compiler flags ($all_flags) works" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3473,17 +3516,17 @@ EOF DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib' ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6 -echo "configure:3477: checking for sys/atomic_op.h" >&5 +echo "configure:3520: checking for sys/atomic_op.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3640,7 +3683,7 @@ EOF _DEBUG_FLAGS='-gdwarf-2 -O0' MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@' echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6 -echo "configure:3644: checking for gethostbyaddr in -lbind" >&5 +echo "configure:3687: checking for gethostbyaddr in -lbind" >&5 ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3648,7 +3691,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3868,17 +3911,17 @@ EOF fi ac_safe=`echo "crt_externs.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for crt_externs.h""... $ac_c" 1>&6 -echo "configure:3872: checking for crt_externs.h" >&5 +echo "configure:3915: checking for crt_externs.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4928,17 +4971,17 @@ EOF _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4932: checking for machine/builtins.h" >&5 +echo "configure:4975: checking for machine/builtins.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5497,7 +5540,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:5501: checking for dlopen in -ldl" >&5 +echo "configure:5544: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5505,7 +5548,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5533,17 +5576,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:5537: checking for dlfcn.h" >&5 +echo "configure:5580: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5576,13 +5619,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:5580: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:5623: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -5600,7 +5643,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -5626,12 +5669,12 @@ LIBS="$LIBS $OS_LIBS" for ac_func in dladdr gettid lchown setpriority strerror syscall do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5630: checking for $ac_func" >&5 +echo "configure:5673: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5706,7 +5749,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5710: checking for $ac_word" >&5 +echo "configure:5753: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CCACHE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5765,7 +5808,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:5769: checking for +Olit support" >&5 +echo "configure:5812: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5807,7 +5850,7 @@ wince*) *) echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:5811: checking for pthread_create in -lpthreads" >&5 +echo "configure:5854: checking for pthread_create in -lpthreads" >&5 echo " #include void *foo(void *v) { return v; } @@ -5829,7 +5872,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5833: checking for pthread_create in -lpthread" >&5 +echo "configure:5876: checking for pthread_create in -lpthread" >&5 echo " #include void *foo(void *v) { return v; } @@ -5851,7 +5894,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5855: checking for pthread_create in -lc_r" >&5 +echo "configure:5898: checking for pthread_create in -lc_r" >&5 echo " #include void *foo(void *v) { return v; } @@ -5873,7 +5916,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5877: checking for pthread_create in -lc" >&5 +echo "configure:5920: checking for pthread_create in -lc" >&5 echo " #include void *foo(void *v) { return v; } @@ -5991,7 +6034,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:5995: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:6038: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -6014,7 +6057,7 @@ echo "configure:5995: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:6018: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:6061: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then diff --git a/nsprpub/configure.in b/nsprpub/configure.in index 4b140c4e9db4..cc250a5cdf57 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -15,7 +15,7 @@ dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 MOD_MINOR_VERSION=10 -MOD_PATCH_VERSION=2 +MOD_PATCH_VERSION=3 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= USE_PTHREADS= @@ -1006,6 +1006,8 @@ dnl = ARM toolchain tweaks dnl ======================================================== dnl Defaults +MOZ_ALIGN=toolchain-default + case "$target" in arm*-android*|arm*-linuxandroid*) MOZ_THUMB=yes @@ -1013,6 +1015,7 @@ arm*-android*|arm*-linuxandroid*) MOZ_FPU=vfp MOZ_FLOAT_ABI=softfp MOZ_SOFT_FLOAT=yes + MOZ_ALIGN=no ;; arm*-*) if test -n "$MOZ_PLATFORM_MAEMO"; then @@ -1148,8 +1151,31 @@ no) ;; esac +case "$MOZ_ALIGN" in +toolchain-default|"") + align_flag="" + ;; +no) + align_flag="-mno-unaligned-access" + ;; +yes) + align_flag="-munaligned-access" + ;; +*) + align_flag="" + ;; +esac + +if test -n "$align_flag"; then + _SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $align_flag" + AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported) + AC_TRY_COMPILE([],[],,align_flag="") + CFLAGS="$_SAVE_CFLAGS" +fi + dnl Use echo to avoid accumulating space characters -all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag` +all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag` if test -n "$all_flags"; then _SAVE_CFLAGS="$CFLAGS" CFLAGS="$all_flags" diff --git a/nsprpub/pr/include/md/_unixos.h b/nsprpub/pr/include/md/_unixos.h index 798d0b33d0e0..04d990414faf 100644 --- a/nsprpub/pr/include/md/_unixos.h +++ b/nsprpub/pr/include/md/_unixos.h @@ -493,6 +493,12 @@ extern PRStatus _MD_MemUnmap(void *addr, PRUint32 size); extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap); #define _MD_CLOSE_FILE_MAP _MD_CloseFileMap +extern PRStatus _MD_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len); +#define _MD_SYNC_MEM_MAP _MD_SyncMemMap + /* * The standard (XPG4) gettimeofday() (from BSD) takes two arguments. * On some SVR4 derivatives, gettimeofday() takes only one argument. diff --git a/nsprpub/pr/include/md/_win95.h b/nsprpub/pr/include/md/_win95.h index b008c13237cd..d65e26437664 100644 --- a/nsprpub/pr/include/md/_win95.h +++ b/nsprpub/pr/include/md/_win95.h @@ -527,6 +527,12 @@ extern PRStatus _MD_MemUnmap(void *addr, PRUint32 size); extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap); #define _MD_CLOSE_FILE_MAP _MD_CloseFileMap +extern PRStatus _MD_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len); +#define _MD_SYNC_MEM_MAP _MD_SyncMemMap + /* --- Named semaphores stuff --- */ #define _PR_HAVE_NAMED_SEMAPHORES #define _MD_OPEN_SEMAPHORE _PR_MD_OPEN_SEMAPHORE diff --git a/nsprpub/pr/include/md/_winnt.h b/nsprpub/pr/include/md/_winnt.h index 4d4d2c12709d..7e5477fdbe38 100644 --- a/nsprpub/pr/include/md/_winnt.h +++ b/nsprpub/pr/include/md/_winnt.h @@ -582,6 +582,12 @@ extern PRStatus _MD_MemUnmap(void *addr, PRUint32 size); extern PRStatus _MD_CloseFileMap(struct PRFileMap *fmap); #define _MD_CLOSE_FILE_MAP _MD_CloseFileMap +extern PRStatus _MD_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len); +#define _MD_SYNC_MEM_MAP _MD_SyncMemMap + /* --- Named semaphores stuff --- */ #define _PR_HAVE_NAMED_SEMAPHORES #define _MD_OPEN_SEMAPHORE _PR_MD_OPEN_SEMAPHORE diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index 557f2e2202b4..111db078f185 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.10.2" +#define PR_VERSION "4.10.3 Beta" #define PR_VMAJOR 4 #define PR_VMINOR 10 -#define PR_VPATCH 2 -#define PR_BETA PR_FALSE +#define PR_VPATCH 3 +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/nsprpub/pr/include/prio.h b/nsprpub/pr/include/prio.h index ac4b270dea47..afea88e9a846 100644 --- a/nsprpub/pr/include/prio.h +++ b/nsprpub/pr/include/prio.h @@ -1854,6 +1854,15 @@ NSPR_API(PRStatus) PR_MemUnmap(void *addr, PRUint32 len); NSPR_API(PRStatus) PR_CloseFileMap(PRFileMap *fmap); +/* + * Synchronously flush the given memory-mapped address range of the given open + * file to disk. + */ +NSPR_API(PRStatus) PR_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len); + /* ****************************************************************** * diff --git a/nsprpub/pr/include/private/primpl.h b/nsprpub/pr/include/private/primpl.h index 5b5469c4f4b8..249f6caa4683 100644 --- a/nsprpub/pr/include/private/primpl.h +++ b/nsprpub/pr/include/private/primpl.h @@ -1974,6 +1974,12 @@ extern PRStatus _PR_MD_MEM_UNMAP(void *addr, PRUint32 size); extern PRStatus _PR_MD_CLOSE_FILE_MAP(PRFileMap *fmap); #define _PR_MD_CLOSE_FILE_MAP _MD_CLOSE_FILE_MAP +extern PRStatus _PR_MD_SYNC_MEM_MAP( + PRFileDesc *fd, + void *addr, + PRUint32 len); +#define _PR_MD_SYNC_MEM_MAP _MD_SYNC_MEM_MAP + /* Named Shared Memory */ /* diff --git a/nsprpub/pr/src/io/prmmap.c b/nsprpub/pr/src/io/prmmap.c index d22ba399fe29..6ffc133056b5 100644 --- a/nsprpub/pr/src/io/prmmap.c +++ b/nsprpub/pr/src/io/prmmap.c @@ -59,3 +59,11 @@ PR_IMPLEMENT(PRStatus) PR_CloseFileMap(PRFileMap *fmap) { return _PR_MD_CLOSE_FILE_MAP(fmap); } + +PR_IMPLEMENT(PRStatus) PR_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len) +{ + return _PR_MD_SYNC_MEM_MAP(fd, addr, len); +} diff --git a/nsprpub/pr/src/md/unix/unix.c b/nsprpub/pr/src/md/unix/unix.c index 02962e6737a3..a3445a5f8fb2 100644 --- a/nsprpub/pr/src/md/unix/unix.c +++ b/nsprpub/pr/src/md/unix/unix.c @@ -3638,6 +3638,23 @@ PRStatus _MD_CloseFileMap(PRFileMap *fmap) return PR_SUCCESS; } +PRStatus _MD_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len) +{ + if (msync(addr, len, MS_SYNC) == 0) { + return PR_SUCCESS; + } else { + if (errno == EINVAL) { + PR_SetError(PR_INVALID_ARGUMENT_ERROR, errno); + } else { + PR_SetError(PR_UNKNOWN_ERROR, errno); + } + return PR_FAILURE; + } +} + #if defined(_PR_NEED_FAKE_POLL) /* diff --git a/nsprpub/pr/src/md/windows/ntmisc.c b/nsprpub/pr/src/md/windows/ntmisc.c index e23f6725e977..7bd40b55156f 100644 --- a/nsprpub/pr/src/md/windows/ntmisc.c +++ b/nsprpub/pr/src/md/windows/ntmisc.c @@ -995,6 +995,23 @@ PRStatus _MD_CloseFileMap(PRFileMap *fmap) return PR_SUCCESS; } +PRStatus _MD_SyncMemMap( + PRFileDesc *fd, + void *addr, + PRUint32 len) +{ + PROsfd osfd; + + osfd = ( fd == (PRFileDesc*)-1 )? -1 : fd->secret->md.osfd; + + if (FlushViewOfFile(addr, len) && FlushFileBuffers((HANDLE) osfd)) { + return PR_SUCCESS; + } else { + PR_SetError(PR_UNKNOWN_ERROR, GetLastError()); + return PR_FAILURE; + } +} + /* *********************************************************************** * diff --git a/nsprpub/pr/src/nspr.def b/nsprpub/pr/src/nspr.def index 7777a3dbe337..1639b97e0ff1 100644 --- a/nsprpub/pr/src/nspr.def +++ b/nsprpub/pr/src/nspr.def @@ -229,6 +229,7 @@ EXPORTS ;- PR_Malloc; PR_MemMap; PR_MemUnmap; + PR_SyncMemMap; PR_MicrosecondsToInterval; PR_MillisecondsToInterval; PR_LockOrderedLock; diff --git a/nsprpub/pr/src/pthreads/ptthread.c b/nsprpub/pr/src/pthreads/ptthread.c index 764ec2c88a8d..2a710ef5bf2c 100644 --- a/nsprpub/pr/src/pthreads/ptthread.c +++ b/nsprpub/pr/src/pthreads/ptthread.c @@ -52,6 +52,7 @@ static struct _PT_Bookeeping PRInt32 system, user; /* a count of the two different types */ PRUintn this_many; /* number of threads allowed for exit */ pthread_key_t key; /* thread private data key */ + PRBool keyCreated; /* whether 'key' should be deleted */ PRThread *first, *last; /* list of threads we know about */ #if defined(_PR_DCETHREADS) || defined(_POSIX_THREAD_PRIORITY_SCHEDULING) PRInt32 minPrio, maxPrio; /* range of scheduling priorities */ @@ -979,9 +980,10 @@ void _PR_InitThreads( * nothing. */ rv = _PT_PTHREAD_KEY_CREATE(&pt_book.key, _pt_thread_death); - PR_ASSERT(0 == rv); + if (0 != rv) PR_Abort(); + pt_book.keyCreated = PR_TRUE; rv = pthread_setspecific(pt_book.key, thred); - PR_ASSERT(0 == rv); + if (0 != rv) PR_Abort(); } /* _PR_InitThreads */ #ifdef __GNUC__ @@ -1041,7 +1043,16 @@ void _PR_Fini(void) void *thred; int rv; - if (!_pr_initialized) return; + if (!_pr_initialized) { + /* Either NSPR was never successfully initialized or + * PR_Cleanup has been called already. */ + if (pt_book.keyCreated) + { + pthread_key_delete(pt_book.key); + pt_book.keyCreated = PR_FALSE; + } + return; + } _PT_PTHREAD_GETSPECIFIC(pt_book.key, thred); if (NULL != thred) diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index 6cfe137474e6..fef03529bb3c 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -20,9 +20,9 @@ #include /* - * This release (4.10.2) is backward compatible with the + * This release (4.10.3) is backward compatible with the * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x, - * 4.8.x, 4.9.x, 4.10, and 4.10.1 releases. + * 4.8.x, 4.9.x, 4.10, 4.10.1 and 4.10.2 releases. * It, of course, is compatible with itself. */ static char *compatible_version[] = { @@ -37,7 +37,7 @@ static char *compatible_version[] = { "4.8.6", "4.8.7", "4.8.8", "4.8.9", "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5", "4.9.6", - "4.10", "4.10.1", + "4.10", "4.10.1", "4.10.2", PR_VERSION }; @@ -53,7 +53,7 @@ static char *incompatible_version[] = { "3.0", "3.0.1", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", - "4.10.3", + "4.10.4", "4.11", "4.11.1", "10.0", "11.1", "12.14.20" };