guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-8-97-gdee


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-8-97-gdeec898
Date: Sun, 14 Mar 2010 22:41:21 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=deec8986ff889724a6fa3fdd9d5e7221473956fe

The branch, master has been updated
       via  deec8986ff889724a6fa3fdd9d5e7221473956fe (commit)
       via  d3b5628c6de88ee08787aab5b1af96f913b77ed4 (commit)
      from  f11871d6c557e706b80e7fa6c0c1f1da854fe1c4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit deec8986ff889724a6fa3fdd9d5e7221473956fe
Author: Ludovic Courtès <address@hidden>
Date:   Sun Mar 14 23:37:00 2010 +0100

    doc: Update "Multi-Threading" node.
    
    * doc/ref/libguile-concepts.texi (Multi-Threading): Remove bits about
      the requirement not to block in guile mode.

commit d3b5628c6de88ee08787aab5b1af96f913b77ed4
Author: Ludovic Courtès <address@hidden>
Date:   Sun Mar 14 23:28:12 2010 +0100

    doc: Remove obsolete reference to the lack of Unicode support.
    
    * doc/ref/api-data.texi (Bytevectors as Strings): Remove obsolete
      footnote on the lack of Unicode support.
    
    * test-suite/tests/bytevectors.test ("2.9 Operations on
      Strings")["string->utf8 [latin-1]", "utf8->string [latin-1]"]: Remove
      use of `with-latin1-locale'.
      ["string->utf32 [Greek]"]: New tests.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/api-data.texi             |    7 +------
 doc/ref/libguile-concepts.texi    |   26 ++++++++++----------------
 test-suite/tests/bytevectors.test |   33 +++++++++++++++++++--------------
 3 files changed, 30 insertions(+), 36 deletions(-)

diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi
index d413567..8153a5d 100755
--- a/doc/ref/api-data.texi
+++ b/doc/ref/api-data.texi
@@ -4406,12 +4406,7 @@ the host's native endianness.
 @cindex Unicode string encoding
 
 Bytevector contents can also be interpreted as Unicode strings encoded
-in one of the most commonly available encoding address@hidden
-1.8 does @emph{not} support Unicode strings.  Therefore, the procedures
-described here assume that Guile strings are internally encoded
-according to the current locale.  For instance, if @code{$LC_CTYPE} is
address@hidden, then @code{string->utf-8} @i{et al.} will
-assume that Guile strings are Latin-1-encoded.}.
+in one of the most commonly available encoding formats.
 
 @lisp
 (utf8->string (u8-list->bytevector '(99 97 102 101)))
diff --git a/doc/ref/libguile-concepts.texi b/doc/ref/libguile-concepts.texi
index 16f07e1..c149730 100644
--- a/doc/ref/libguile-concepts.texi
+++ b/doc/ref/libguile-concepts.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2010
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -450,21 +450,15 @@ that are stored in local variables.  When a thread puts 
itself into
 guile mode for the first time, it gets a Scheme representation and is
 listed by @code{all-threads}, for example.
 
-While in guile mode, a thread promises to reach a safe point
-reasonably frequently (@pxref{Asynchronous Signals}).  In addition to
-running signal handlers, these points are also potential rendezvous
-points of all guile mode threads where Guile can orchestrate global
-things like garbage collection.  Consequently, when a thread in guile
-mode blocks and does no longer frequent safe points, it might cause
-all other guile mode threads to block as well.  To prevent this from
-happening, a guile mode thread should either only block in libguile
-functions (who know how to do it right), or should temporarily leave
-guile mode with @code{scm_without_guile}.
-
-For some common blocking operations, Guile provides convenience
-functions.  For example, if you want to lock a pthread mutex while in
-guile mode, you might want to use @code{scm_pthread_mutex_lock} which is
-just like @code{pthread_mutex_lock} except that it leaves guile mode
+Threads in guile mode can block (e.g., do blocking I/O) without causing any
address@hidden Guile 1.8, a thread blocking in guile mode would prevent
+garbage collection to occur.  Thus, threads had to leave guile mode whenever
+they could block.  This is no longer needed with Guile 2.0.}; temporarily
+leaving guile mode with @code{scm_without_guile} before blocking slightly
+improves GC performance, though.  For some common blocking operations, Guile
+provides convenience functions.  For example, if you want to lock a pthread
+mutex while in guile mode, you might want to use @code{scm_pthread_mutex_lock}
+which is just like @code{pthread_mutex_lock} except that it leaves guile mode
 while blocking.
 
 
diff --git a/test-suite/tests/bytevectors.test 
b/test-suite/tests/bytevectors.test
index 3f68c81..3a7cc2d 100644
--- a/test-suite/tests/bytevectors.test
+++ b/test-suite/tests/bytevectors.test
@@ -1,7 +1,7 @@
-;;;; bytevectors.test --- R6RS bytevectors. -*- mode: scheme; coding: 
iso-8859-1; -*-
+;;;; bytevectors.test --- R6RS bytevectors. -*- mode: scheme; coding: utf-8; 
-*-
 ;;;;
 ;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
-;;;; Ludovic Courtès
+;;;; Ludovic Courtès
 ;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
@@ -394,12 +394,11 @@
                    (map integer->char (bytevector->u8-list utf8))))))
 
   (pass-if "string->utf8 [latin-1]"
-    (with-latin1-locale
-      (let* ((str  "hé, ça va bien ?")
-             (utf8 (string->utf8 str)))
-        (and (bytevector? utf8)
-             (= (bytevector-length utf8)
-                (+ 2 (string-length str)))))))
+    (let* ((str  "hé, ça va bien ?")
+           (utf8 (string->utf8 str)))
+      (and (bytevector? utf8)
+           (= (bytevector-length utf8)
+              (+ 2 (string-length str))))))
 
   (pass-if "string->utf16"
     (let* ((str   "hello, world")
@@ -435,6 +434,13 @@
                         (bytevector->uint-list utf32
                                                (endianness big) 4))))))
 
+  (pass-if "string->utf32 [Greek]"
+    (let* ((str   "Ἄνεμοι")
+           (utf32 (string->utf32 str)))
+      (and (bytevector? utf32)
+           (equal? (bytevector->uint-list utf32 (endianness big) 4)
+                   '(#x1f0c #x3bd #x3b5 #x3bc #x3bf #x3b9)))))
+
   (pass-if "string->utf32 [little]"
     (let* ((str   "hello, world")
            (utf32 (string->utf32 str (endianness little))))
@@ -457,12 +463,11 @@
                    (map integer->char (bytevector->u8-list utf8))))))
 
   (pass-if "utf8->string [latin-1]"
-    (with-latin1-locale
-      (let* ((utf8  (string->utf8 "hé, ça va bien ?"))
-             (str   (utf8->string utf8)))
-        (and (string? str)
-             (= (string-length str)
-                (- (bytevector-length utf8) 2))))))
+    (let* ((utf8  (string->utf8 "hé, ça va bien ?"))
+           (str   (utf8->string utf8)))
+      (and (string? str)
+           (= (string-length str)
+              (- (bytevector-length utf8) 2)))))
 
   (pass-if "utf16->string"
     (let* ((utf16  (uint-list->bytevector (map char->integer


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]