Mercurial > emacs
comparison src/alloc.c @ 60143:84ff5b7a4139
(BLOCK_BYTES): Harmless typo.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Fri, 18 Feb 2005 18:16:09 +0000 |
| parents | f3aa25eacdb3 |
| children | 25e4a0f171b5 389421e988c2 bf0d492ea2d5 |
comparison
equal
deleted
inserted
replaced
| 60142:d1fdce4dfc73 | 60143:84ff5b7a4139 |
|---|---|
| 1 /* Storage allocation and gc for GNU Emacs Lisp interpreter. | 1 /* Storage allocation and gc for GNU Emacs Lisp interpreter. |
| 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, | 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, |
| 3 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | 3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
| 6 | 6 |
| 7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 888 malloc a chance to minimize the amount of memory wasted to alignment. | 888 malloc a chance to minimize the amount of memory wasted to alignment. |
| 889 It should be tuned to the particular malloc library used. | 889 It should be tuned to the particular malloc library used. |
| 890 On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best. | 890 On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best. |
| 891 posix_memalign on the other hand would ideally prefer a value of 4 | 891 posix_memalign on the other hand would ideally prefer a value of 4 |
| 892 because otherwise, there's 1020 bytes wasted between each ablocks. | 892 because otherwise, there's 1020 bytes wasted between each ablocks. |
| 893 But testing shows that those 1020 will most of the time be efficiently | 893 In Emacs, testing shows that those 1020 can most of the time be |
| 894 used by malloc to place other objects, so a value of 0 is still preferable | 894 efficiently used by malloc to place other objects, so a value of 0 can |
| 895 unless you have a lot of cons&floats and virtually nothing else. */ | 895 still preferable unless you have a lot of aligned blocks and virtually |
| 896 nothing else. */ | |
| 896 #define BLOCK_PADDING 0 | 897 #define BLOCK_PADDING 0 |
| 897 #define BLOCK_BYTES \ | 898 #define BLOCK_BYTES \ |
| 898 (BLOCK_ALIGN - sizeof (struct aligned_block *) - BLOCK_PADDING) | 899 (BLOCK_ALIGN - sizeof (struct ablock *) - BLOCK_PADDING) |
| 899 | 900 |
| 900 /* Internal data structures and constants. */ | 901 /* Internal data structures and constants. */ |
| 901 | 902 |
| 902 #define ABLOCKS_SIZE 16 | 903 #define ABLOCKS_SIZE 16 |
| 903 | 904 |
