зеркало из https://github.com/github/ruby.git
* missing/explicit_bzero.c: new file. define explicit_bzero.
* common.mk: add a rule for explicit.o. * configure.in: detect explicit_bzero and memset_s. * include/ruby/missing.h: add explicit_bzero. * random.c (init_randomseed): use explicit_bzero() instead of memset(). memset could be eliminated by compiler optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
4eeec4869f
Коммит
dea685c783
|
@ -1,3 +1,12 @@
|
|||
Sun Oct 18 17:26:53 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* missing/explicit_bzero.c: new file. define explicit_bzero.
|
||||
* common.mk: add a rule for explicit.o.
|
||||
* configure.in: detect explicit_bzero and memset_s.
|
||||
* include/ruby/missing.h: add explicit_bzero.
|
||||
* random.c (init_randomseed): use explicit_bzero() instead of
|
||||
memset(). memset could be eliminated by compiler optimization.
|
||||
|
||||
Mon Nov 30 18:46:44 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* ext/readline/extconf.rb: call dir_config("libedit")
|
||||
|
|
|
@ -705,6 +705,7 @@ alloca.$(OBJEXT): {$(VPATH)}alloca.c {$(VPATH)}config.h
|
|||
crypt.$(OBJEXT): {$(VPATH)}crypt.c
|
||||
dup2.$(OBJEXT): {$(VPATH)}dup2.c
|
||||
erf.$(OBJEXT): {$(VPATH)}erf.c
|
||||
explicit_bzero.$(OBJEXT): {$(VPATH)}explicit_bzero.c
|
||||
finite.$(OBJEXT): {$(VPATH)}finite.c
|
||||
flock.$(OBJEXT): {$(VPATH)}flock.c
|
||||
memcmp.$(OBJEXT): {$(VPATH)}memcmp.c
|
||||
|
|
|
@ -2127,6 +2127,7 @@ AC_REPLACE_FUNCS(cbrt)
|
|||
AC_REPLACE_FUNCS(crypt)
|
||||
AC_REPLACE_FUNCS(dup2)
|
||||
AC_REPLACE_FUNCS(erf)
|
||||
AC_REPLACE_FUNCS(explicit_bzero)
|
||||
AC_REPLACE_FUNCS(ffs)
|
||||
AC_REPLACE_FUNCS(finite)
|
||||
AC_REPLACE_FUNCS(flock)
|
||||
|
@ -2255,6 +2256,7 @@ AC_CHECK_FUNCS(malloc_usable_size)
|
|||
AC_CHECK_FUNCS(malloc_size)
|
||||
AC_CHECK_FUNCS(mblen)
|
||||
AC_CHECK_FUNCS(memalign)
|
||||
AC_CHECK_FUNCS(memset_s)
|
||||
AC_CHECK_FUNCS(writev)
|
||||
AC_CHECK_FUNCS(memrchr)
|
||||
AC_CHECK_FUNCS(memmem)
|
||||
|
|
|
@ -242,6 +242,10 @@ RUBY_EXTERN int ruby_close(int);
|
|||
RUBY_EXTERN void setproctitle(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EXPLICIT_BZERO
|
||||
RUBY_EXTERN void explicit_bzero(void *b, size_t len);
|
||||
#endif
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
2
random.c
2
random.c
|
@ -1456,7 +1456,7 @@ init_randomseed(struct MT *mt, uint32_t initial[DEFAULT_SEED_CNT])
|
|||
fill_random_seed(initial);
|
||||
init_by_array(mt, initial, DEFAULT_SEED_CNT);
|
||||
seed = make_seed_value(initial);
|
||||
memset(initial, 0, DEFAULT_SEED_LEN);
|
||||
explicit_bzero(initial, DEFAULT_SEED_LEN);
|
||||
return seed;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче