[前][次][番号順一覧][スレッド一覧]

ruby-changes:40766

From: nobu <ko1@a...>
Date: Wed, 2 Dec 2015 09:55:55 +0900 (JST)
Subject: [ruby-changes:40766] nobu:r52845 (trunk): explicit_bzero.c: fix comments

nobu	2015-12-02 09:55:50 +0900 (Wed, 02 Dec 2015)

  New Revision: 52845

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52845

  Log:
    explicit_bzero.c: fix comments
    
    * missing/explicit_bzero.c: fix comments.  Microsoft Visual Studio
      does not provide memset_s() in 12.0 at least.

  Modified files:
    trunk/missing/explicit_bzero.c
Index: missing/explicit_bzero.c
===================================================================
--- missing/explicit_bzero.c	(revision 52844)
+++ missing/explicit_bzero.c	(revision 52845)
@@ -5,17 +5,18 @@ https://github.com/ruby/ruby/blob/trunk/missing/explicit_bzero.c#L5
 #include <windows.h>
 #endif
 
-/* Similar to bzero(), but have a guarantee not to be eliminated from compiler
+/* Similar to bzero(), but has a guarantee not to be eliminated from compiler
    optimization. */
 
 /* OS support note:
- * BSD have explicit_bzero().
- * Windows, OS-X have memset_s().
+ * BSDs have explicit_bzero().
+ * OS-X has memset_s().
+ * Windows has SecureZeroMemory() since XP.
  * Linux has none. *Sigh*
  */
 
 /*
- * Following URL explain why memset_s is added to the standard.
+ * Following URL explains why memset_s is added to the standard.
  * http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1381.pdf
  */
 
@@ -40,7 +41,7 @@ explicit_bzero(void *b, size_t len) https://github.com/ruby/ruby/blob/trunk/missing/explicit_bzero.c#L41
 
  #elif defined HAVE_FUNC_WEAK
 
-/* A weak function never be optimization away. Even if nobody use it. */
+/* A weak function never be optimized away. Even if nobody uses it. */
 WEAK(void ruby_explicit_bzero_hook_unused(void *buf, size_t len));
 void
 ruby_explicit_bzero_hook_unused(void *buf, size_t len)
@@ -64,8 +65,8 @@ explicit_bzero(void *b, size_t len) https://github.com/ruby/ruby/blob/trunk/missing/explicit_bzero.c#L65
 {
     /*
      * volatile is not enough if compiler have a LTO (link time
-     * optimization). At least, the standard provide no guarantee.
-     * However, gcc and major other compiler never optimization a volatile
+     * optimization). At least, the standard provides no guarantee.
+     * However, gcc and major other compiler never optimize a volatile
      * variable away. So, using volatile is practically ok.
      */
     volatile char* p = (volatile char*)b;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]