[uim-commit] r2901 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Fri Jan 13 03:32:23 PST 2006
Author: yamaken
Date: 2006-01-13 03:32:20 -0800 (Fri, 13 Jan 2006)
New Revision: 2901
Modified:
branches/r5rs/sigscheme/config.h
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/storage-compact.h
branches/r5rs/sigscheme/storage-fatty.h
branches/r5rs/sigscheme/storage.c
Log:
* sigscheme/config.h
- Include stdint.h
- (SCM_FULLY_ADDRESSABLEP, SCM_DEFAULT_HEAP_SIZE,
SCM_DEFAULT_HEAP_ALLOC_THRESHOLD, SCM_DEFAULT_N_HEAPS_MAX,
SCM_DEFAULT_N_HEAPS_INIT, SCM_DEFAULT_SYMBOL_HASH_SIZE): New macro
* sigscheme/storage.c
- (default_storage_conf):
* Replace values with the macros
* Max size of heaps is expanded to full address space
* sigscheme/sigscheme.h
- (SCM_PTR_BITS): New macro
* sigscheme/storage-fatty.h
- (SCM_SAL_PTR_BITS): New macro
* sigscheme/storage-compact.h
- (SCM_SAL_PTR_BITS): New macro
Modified: branches/r5rs/sigscheme/config.h
===================================================================
--- branches/r5rs/sigscheme/config.h 2006-01-13 10:53:25 UTC (rev 2900)
+++ branches/r5rs/sigscheme/config.h 2006-01-13 11:32:20 UTC (rev 2901)
@@ -34,6 +34,8 @@
#ifndef __SIGSCHEME_CONFIG_H
#define __SIGSCHEME_CONFIG_H
+#include <stdint.h> /* FIXME: make C99-independent */
+
/*===========================================================================
Optional Features Written in C
===========================================================================*/
@@ -98,6 +100,17 @@
#define SCM_LBUF_F_STRING scm_lbuf_f_linear
#define SCM_LBUF_F_SYMBOL scm_lbuf_f_linear
+#define SCM_FULLY_ADDRESSABLEP \
+ (SCM_PTR_BITS == (sizeof(void *) * CHAR_BIT))
+
+#define SCM_DEFAULT_HEAP_SIZE 0x4000
+#define SCM_DEFAULT_HEAP_ALLOC_THRESHOLD (SCM_DEFAULT_HEAP_SIZE / 2)
+#define SCM_DEFAULT_N_HEAPS_MAX \
+ (((SCM_FULLY_ADDRESSABLEP) ? (uintptr_t)-1 : (1 << SCM_PTR_BITS)) \
+ / (SCM_DEFAULT_HEAP_SIZE * sizeof(ScmCell)))
+#define SCM_DEFAULT_N_HEAPS_INIT 1
+#define SCM_DEFAULT_SYMBOL_HASH_SIZE 0x400
+
/*===========================================================================
Debugging
===========================================================================*/
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2006-01-13 10:53:25 UTC (rev 2900)
+++ branches/r5rs/sigscheme/sigscheme.h 2006-01-13 11:32:20 UTC (rev 2901)
@@ -418,6 +418,9 @@
#define SCM_HAS_IMMEDIATE_REAL_ONLY SCM_SAL_HAS_IMMEDIATE_REAL_ONLY
#define SCM_HAS_IMMEDIATE_COMPLEX_ONLY SCM_SAL_HAS_IMMEDIATE_COMPLEX_ONLY
+/* addressable space: tag bits multiplexed in alignment part is also counted */
+#define SCM_PTR_BITS SCM_SAL_PTR_BITS
+
#define SCM_CHAR_BITS SCM_SAL_CHAR_BITS
#define SCM_CHAR_MAX SCM_SAL_CHAR_MAX
#define SCM_CHAR_MIN 0
Modified: branches/r5rs/sigscheme/storage-compact.h
===================================================================
--- branches/r5rs/sigscheme/storage-compact.h 2006-01-13 10:53:25 UTC (rev 2900)
+++ branches/r5rs/sigscheme/storage-compact.h 2006-01-13 11:32:20 UTC (rev 2901)
@@ -132,6 +132,7 @@
/*=======================================
System Include
=======================================*/
+#include <limits.h>
#include <stdint.h> /* FIXME: make C99-independent */
#include <stdio.h>
@@ -651,6 +652,8 @@
#define SCM_SAL_HAS_IMMEDIATE_REAL_ONLY 0
#define SCM_SAL_HAS_IMMEDIATE_COMPLEX_ONLY 0
+#define SCM_SAL_PTR_BITS (sizeof(void *) * CHAR_BIT)
+
#define SCM_SAL_CHAR_BITS /* FIXME */
#define SCM_SAL_CHAR_MAX /* FIXME */
Modified: branches/r5rs/sigscheme/storage-fatty.h
===================================================================
--- branches/r5rs/sigscheme/storage-fatty.h 2006-01-13 10:53:25 UTC (rev 2900)
+++ branches/r5rs/sigscheme/storage-fatty.h 2006-01-13 11:32:20 UTC (rev 2901)
@@ -148,6 +148,8 @@
#define SCM_SAL_HAS_IMMEDIATE_REAL_ONLY 0
#define SCM_SAL_HAS_IMMEDIATE_COMPLEX_ONLY 0
+#define SCM_SAL_PTR_BITS (sizeof(void *) * CHAR_BIT)
+
#define SCM_SAL_CHAR_BITS SCM_INT_BITS
#define SCM_SAL_CHAR_MAX SCM_INT_MAX
Modified: branches/r5rs/sigscheme/storage.c
===================================================================
--- branches/r5rs/sigscheme/storage.c 2006-01-13 10:53:25 UTC (rev 2900)
+++ branches/r5rs/sigscheme/storage.c 2006-01-13 11:32:20 UTC (rev 2901)
@@ -80,11 +80,11 @@
#endif
static const ScmStorageConf default_storage_conf = {
- 0x4000, /* number of ScmCell in a heap */
- 0x2000, /* number of freecells always being preserved */
- 0x800, /* max number of heaps */
- 1, /* initial number of heaps */
- 0x400 /* hash size of symbol table */
+ SCM_DEFAULT_HEAP_SIZE,
+ SCM_DEFAULT_HEAP_ALLOC_THRESHOLD,
+ SCM_DEFAULT_N_HEAPS_MAX,
+ SCM_DEFAULT_N_HEAPS_INIT,
+ SCM_DEFAULT_SYMBOL_HASH_SIZE
};
/*=======================================
More information about the uim-commit
mailing list