gnutls-commit
[Top][All Lists]
Advanced

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

[SCM] GNU gnutls branch, master, updated. gnutls_2_9_6-11-gb595d16


From: Ludovic Courtès
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_9_6-11-gb595d16
Date: Mon, 28 Sep 2009 20:49:08 +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 gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=b595d1625e13a1836df6504ee1bafe1ef067726f

The branch, master has been updated
       via  b595d1625e13a1836df6504ee1bafe1ef067726f (commit)
       via  cf61dc7006b8789951b058573ae1f824b264bd96 (commit)
       via  2290dcb96e78e14b2a9cfa3158abc9d52f72d888 (commit)
      from  17edc60deccccfd93a1290e27f8643b68a6c2dda (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 b595d1625e13a1836df6504ee1bafe1ef067726f
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 28 22:46:33 2009 +0200

    guile: Adjust for Guile 1.9.3+.
    
    * guile/src/core.c (mark_session_record_port, free_session_record_port):
      Conditionalize on `SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8'.
      (scm_init_gnutls_session_record_port_type): Adjust accordingly.
      (make_session_record_port): Use `scm_gc_malloc_pointerless ()' when
      available.

commit cf61dc7006b8789951b058573ae1f824b264bd96
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 28 22:40:08 2009 +0200

    guile: Syntactic nitpicking.
    
    * guile/src/core.c (SCM_GNUTLS_MAKE_SESSION_DATA,
      SCM_GNUTLS_SET_SESSION_RECORD_PORT): Remove extraneous semicolon.

commit 2290dcb96e78e14b2a9cfa3158abc9d52f72d888
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 28 22:39:03 2009 +0200

    guile: Use Guile's malloc routines.
    
    * guile/src/core.c (scm_init_gnutls): Use Guile's malloc routines.

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

Summary of changes:
 configure.ac     |    9 +++++++++
 guile/src/core.c |   33 ++++++++++++++++++++++++++-------
 2 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 47203a6..77297ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,15 @@ if test "$opt_guile_bindings" = "yes"; then
                           gnu89_inline=yes, gnu89_inline=no)
         AC_MSG_RESULT($gnu89_inline)
         CFLAGS="$_gcc_cflags_save"
+
+       # Optional Guile functions.
+       save_CFLAGS="$CFLAGS"
+       save_LIBS="$LIBS"
+       CFLAGS="$CFLAGS $GUILE_CFLAGS"
+       LIBS="$LIBS $GUILE_LDFLAGS"
+       AC_CHECK_FUNCS([scm_gc_malloc_pointerless])
+       CFLAGS="$save_CFLAGS"
+       LIBS="$save_LIBS"
       else
         AC_MSG_RESULT([no])
         AC_MSG_WARN([A sufficiently recent GNU Guile not found.  Guile 
bindings not built.])
diff --git a/guile/src/core.c b/guile/src/core.c
index f791ef8..c0ded90 100644
--- a/guile/src/core.c
+++ b/guile/src/core.c
@@ -60,7 +60,7 @@ const char scm_gnutls_array_error_message[] =
    marked by the session mark procedure.  */
 
 #define SCM_GNUTLS_MAKE_SESSION_DATA()         \
-  scm_cons (SCM_BOOL_F, SCM_BOOL_F);
+  scm_cons (SCM_BOOL_F, SCM_BOOL_F)
 #define SCM_GNUTLS_SET_SESSION_DATA(c_session, data)                   \
   gnutls_session_set_ptr (c_session, (void *) SCM_UNPACK (data))
 #define SCM_GNUTLS_SESSION_DATA(c_session)                     \
@@ -70,7 +70,7 @@ const char scm_gnutls_array_error_message[] =
   SCM_SETCAR (SCM_GNUTLS_SESSION_DATA (c_session),                     \
              scm_from_bool (c_is_fd))
 #define SCM_GNUTLS_SET_SESSION_RECORD_PORT(c_session, port)    \
-  SCM_SETCDR (SCM_GNUTLS_SESSION_DATA (c_session), port);
+  SCM_SETCDR (SCM_GNUTLS_SESSION_DATA (c_session), port)
 
 #define SCM_GNUTLS_SESSION_TRANSPORT_IS_FD(c_session)          \
   scm_to_bool (SCM_CAR (SCM_GNUTLS_SESSION_DATA (c_session)))
@@ -720,6 +720,9 @@ static scm_t_bits session_record_port_type;
 static const char session_record_port_gc_hint[] =
   "gnutls-session-record-port";
 
+
+#if SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8
+
 /* Mark the session associated with PORT.  */
 static SCM
 mark_session_record_port (SCM port)
@@ -755,9 +758,11 @@ free_session_record_port (SCM port)
 
   return 0;
 }
-
 #undef FUNC_NAME
 
+#endif /* SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8 */
+
+
 /* Data passed to `do_fill_port ()'.  */
 typedef struct
 {
@@ -865,7 +870,12 @@ make_session_record_port (SCM session)
 
   c_port_buf =
     (unsigned char *)
-    scm_gc_malloc (SCM_GNUTLS_SESSION_RECORD_PORT_BUFFER_SIZE,
+#ifdef HAVE_SCM_GC_MALLOC_POINTERLESS
+    scm_gc_malloc_pointerless
+#else
+    scm_gc_malloc
+#endif
+                  (SCM_GNUTLS_SESSION_RECORD_PORT_BUFFER_SIZE,
                   session_record_port_gc_hint);
 
   /* Create a new port.  */
@@ -921,8 +931,14 @@ scm_init_gnutls_session_record_port_type (void)
     scm_make_port_type ("gnutls-session-port",
                        fill_session_record_port_input,
                        write_to_session_record_port);
+
+  /* Guile >= 1.9.3 doesn't need a custom mark procedure, and doesn't need a
+     finalizer (since memory associated with the port is automatically
+     reclaimed.)  */
+#if SCM_MAJOR_VERSION == 1 && SCM_MINOR_VERSION <= 8
   scm_set_port_mark (session_record_port_type, mark_session_record_port);
   scm_set_port_free (session_record_port_type, free_session_record_port);
+#endif
 }
 
 
@@ -2790,6 +2806,12 @@ scm_init_gnutls (void)
 {
 #include "core.x"
 
+  /* Use Guile's allocation routines, which will run the GC if need be.  */
+  gnutls_malloc = scm_malloc;
+  gnutls_realloc = scm_realloc;
+  gnutls_secure_malloc = scm_malloc;
+  gnutls_free = free;
+
   (void) gnutls_global_init ();
 
   scm_gnutls_define_enums ();
@@ -2798,6 +2820,3 @@ scm_init_gnutls (void)
 
   scm_init_gnutls_session_record_port_type ();
 }
-
-/* arch-tag: 58420abe-0769-4684-b522-da7f32f4474c
- */


hooks/post-receive
-- 
GNU gnutls




reply via email to

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