5% seems like a reasonable compromise between latency and throughput.
Also change a few related stray size_t types to os_vm_size_t, which
necessitates moving runtime options saving bits into their own header file.
STANDARD-INSTANCE-ACCESS, and FUNCALLABLE-STANDARD-INSTANCE-ACCESS.
** Users can now defined new places usable with SB-EXT:COMPARE-AND-SWAP
using an API anologous to defining new SETFable places.
- * enchancement: on CHENEYGC targets, SB-KERNEL:MAKE-LISP-OBJ now does
+ * enhancement: on GENCGC systems nursery size now defaults to 5% of
+ dynamic-space size.
+ * enhancement: on CHENEYGC targets, SB-KERNEL:MAKE-LISP-OBJ now does
the same validation of pointer objects as GENCGC does, instead of a
comparatively weak bounds-check against the heap spaces.
* enhancement: on win32, ABS of complex floats guards better against
(defun bytes-consed-between-gcs ()
#!+sb-doc
"The amount of memory that will be allocated before the next garbage
-collection is initiated. This can be set with SETF."
+collection is initiated. This can be set with SETF.
+
+On GENCGC platforms this is the nursery size, and defaults to 5% of dynamic
+space size.
+
+Note: currently changes to this value are lost when saving core."
(sb!alien:extern-alien "bytes_consed_between_gcs" os-vm-size-t))
(defun (setf bytes-consed-between-gcs) (val)
#include "validate.h"
#include "gc-internal.h"
+#include "runtime-options.h"
#include <errno.h>
static struct runtime_options *
read_runtime_options(int fd)
{
- size_t optarray[RUNTIME_OPTIONS_WORDS];
+ os_vm_size_t optarray[RUNTIME_OPTIONS_WORDS];
struct runtime_options *options = NULL;
- if (read(fd, optarray, RUNTIME_OPTIONS_WORDS * sizeof(size_t)) !=
+ if (read(fd, optarray, RUNTIME_OPTIONS_WORDS * sizeof(os_vm_size_t)) !=
RUNTIME_OPTIONS_WORDS * sizeof(size_t)) {
return NULL;
}
#endif
#endif
-size_t dynamic_space_size = DEFAULT_DYNAMIC_SPACE_SIZE;
-size_t thread_control_stack_size = DEFAULT_CONTROL_STACK_SIZE;
+os_vm_size_t dynamic_space_size = DEFAULT_DYNAMIC_SPACE_SIZE;
+os_vm_size_t thread_control_stack_size = DEFAULT_CONTROL_STACK_SIZE;
inline static boolean
forwarding_pointer_p(lispobj *pointer) {
page_table_pages = dynamic_space_size/GENCGC_CARD_BYTES;
gc_assert(dynamic_space_size == npage_bytes(page_table_pages));
+ /* Default nursery size to 5% of the total dynamic space size,
+ * min 1Mb. */
+ bytes_consed_between_gcs = dynamic_space_size/(os_vm_size_t)20;
+ if (bytes_consed_between_gcs < (1024*1024))
+ bytes_consed_between_gcs = 1024*1024;
+
/* The page_table must be allocated using "calloc" to initialize
* the page structures correctly. There used to be a separate
* initialization loop (now commented out; see below) but that was
#endif
#include "sbcl.h"
+#include "runtime-options.h"
#ifndef LANGUAGE_ASSEMBLY
foreign_function_call_active
#endif
-extern size_t dynamic_space_size;
-extern size_t thread_control_stack_size;
+extern os_vm_size_t dynamic_space_size;
+extern os_vm_size_t thread_control_stack_size;
extern struct runtime_options *runtime_options;
clear_auto_gc_trigger(); /* restore mmap as it was given by os */
#endif
- os_zero((os_vm_address_t) current_dynamic_space,
- (os_vm_size_t) dynamic_space_size);
+ os_zero((os_vm_address_t) current_dynamic_space, dynamic_space_size);
/* Zero the stack. */
os_zero((os_vm_address_t) access_control_stack_pointer(all_threads),
--- /dev/null
+/*
+ * This software is part of the SBCL system. See the README file for
+ * more information.
+ *
+ * This software is derived from the CMU CL system, which was
+ * written at Carnegie Mellon University and released into the
+ * public domain. The software is in the public domain and is
+ * provided with absolutely no warranty. See the COPYING and CREDITS
+ * files for more information.
+ */
+
+#ifndef _RUNTIME_OPTIONS_INCLUDED_
+#define _RUNTIME_OPTIONS_INCLUDED_
+
+#include "os.h"
+
+#define RUNTIME_OPTIONS_MAGIC 0x31EBF355
+/* 1 for magic, 1 for boolean, 2 for struct runtime_options fields */
+#define RUNTIME_OPTIONS_WORDS (1 + 1 + 2)
+
+struct runtime_options {
+ os_vm_size_t dynamic_space_size;
+ os_vm_size_t thread_control_stack_size;
+};
+
+/* saved runtime path computed from argv[0] */
+extern char *saved_runtime_path;
+
+#endif
extern void *successful_malloc (size_t size);
extern char *copied_string (char *string);
-#define RUNTIME_OPTIONS_MAGIC 0x31EBF355
-/* 1 for magic, 1 for boolean, 2 for struct runtime_options fields */
-#define RUNTIME_OPTIONS_WORDS (1 + 1 + 2)
-
-struct runtime_options {
- size_t dynamic_space_size;
- size_t thread_control_stack_size;
-};
-
-/* saved runtime path computed from argv[0] */
-extern char *saved_runtime_path;
-
#endif /* _SBCL_RUNTIME_H_ */