[svn] gcry - r1129 - trunk/src
svn author mo
cvs at cvs.gnupg.org
Sun Oct 16 10:46:06 CEST 2005
Author: mo
Date: 2005-10-16 10:46:06 +0200 (Sun, 16 Oct 2005)
New Revision: 1129
Modified:
trunk/src/ChangeLog
trunk/src/stdmem.c
Log:
2005-10-16 Moritz Schulte <moritz at g10code.com>
* stdmem.c: Inserted description of the layered memory management
in Libgcrypt.
Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog 2005-10-16 08:45:41 UTC (rev 1128)
+++ trunk/src/ChangeLog 2005-10-16 08:46:06 UTC (rev 1129)
@@ -1,10 +1,22 @@
2005-10-16 Moritz Schulte <moritz at g10code.com>
+ * stdmem.c: Inserted description of the layered memory management
+ in Libgcrypt.
+
* g10lib.h: Removed G10_I18N_H related check; it seems to be a
GnuPG relict (Libgcrypt does not define this symbol anywhere).
(FLAG_MODULE_DISABLED): Don't forget parantheses around shifted
value.
+
+ Removed GCC_ATTR_PURE macro definitions, since gcrypt.h does
+ already contain such a macro named _GCRY_GCC_ATTR_PURE, which we
+ can use here as well.
+ Likewise for GCC_ATTR_MALLOC and _GCRY_GCC_ATTR_MALLOC.
+
+ * stdmem.h: Use _GCRY_GCC_ATTR_MALLOC instead of GCC_ATTR_MALLOC.
+ * secmem.h: Likewise.
+
2005-10-09 Moritz Schulte <moritz at g10code.com>
* global.c (gcry_control): Call global_init() after passing thread
Modified: trunk/src/stdmem.c
===================================================================
--- trunk/src/stdmem.c 2005-10-16 08:45:41 UTC (rev 1128)
+++ trunk/src/stdmem.c 2005-10-16 08:46:06 UTC (rev 1129)
@@ -1,5 +1,5 @@
/* stdmem.c - private memory allocator
- * Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
@@ -18,6 +18,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+/*
+ * Description of the layered memory management in Libgcrypt:
+ *
+ * [User]
+ * |
+ * |
+ * \ /
+ * global.c: [MM entrance points] -----> [user callbacks]
+ * | |
+ * | |
+ * \ / \ /
+ *
+ * stdmem.c: [non-secure handlers] [secure handlers]
+ *
+ * | |
+ * | |
+ * \ / \ /
+ *
+ * stdmem.c: [ memory guard ]
+ *
+ * | |
+ * | |
+ * \ / \ /
+ *
+ * libc: [ MM functions ] secmem.c: [ secure MM functions]
+ */
+
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
@@ -28,6 +55,7 @@
#include "stdmem.h"
#include "secmem.h"
+
#define MAGIC_NOR_BYTE 0x55
#define MAGIC_SEC_BYTE 0xcc
More information about the Gnupg-commits
mailing list