Initial revision
[sbcl.git] / src / pcl / precom1.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3
4 ;;;; This software is derived from software originally released by Xerox
5 ;;;; Corporation. Copyright and release statements follow. Later modifications
6 ;;;; to the software are in the public domain and are provided with
7 ;;;; absolutely no warranty. See the COPYING and CREDITS files for more
8 ;;;; information.
9
10 ;;;; copyright information from original PCL sources:
11 ;;;;
12 ;;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 Xerox Corporation.
13 ;;;; All rights reserved.
14 ;;;;
15 ;;;; Use and copying of this software and preparation of derivative works based
16 ;;;; upon this software are permitted. Any distribution of this software or
17 ;;;; derivative works must comply with all applicable United States export
18 ;;;; control laws.
19 ;;;;
20 ;;;; This software is made available AS IS, and Xerox Corporation makes no
21 ;;;; warranty about the software, its performance or its conformity to any
22 ;;;; specification.
23
24 (in-package "SB-PCL")
25
26 (sb-int:file-comment
27   "$Header$")
28 \f
29 ;;; Pre-allocate generic function caches. The hope is that this will put
30 ;;; them nicely together in memory, and that that may be a win. Of course
31 ;;; the first gc copy will probably blow that out, this really wants to be
32 ;;; wrapped in something that declares the area static.
33 ;;;
34 ;;; This preallocation only creates about 25% more caches than PCL itself
35 ;;; uses need. Some ports may want to preallocate some more of these.
36 (flet ((allocate (n size)
37                  (mapcar #'free-cache-vector
38                          (mapcar #'get-cache-vector
39                                  (make-list n :initial-element size)))))
40   (allocate 128 4)
41   (allocate 64 8)
42   (allocate 64 9)
43   (allocate 32 16)
44   (allocate 16 17)
45   (allocate 16 32)
46   (allocate 1  64))