annotate src/mc-alloc.h @ 5084:6afe991b8135

Add a PARSE_KEYWORDS macro, use it in #'make-hash-table. lisp/ChangeLog addition: 2010-03-01 Aidan Kehoe <kehoea@parhasard.net> * cl-seq.el (cl-parsing-keywords): * cl-macs.el (cl-do-arglist): Use the new invalid-keyword-argument error here. src/ChangeLog addition: 2010-03-01 Aidan Kehoe <kehoea@parhasard.net> * lisp.h (PARSE_KEYWORDS): New macro, for parsing keyword arguments from C subrs. * elhash.c (Fmake_hash_table): Use it. * general-slots.h (Q_allow_other_keys): Add this symbol. * eval.c (non_nil_allow_other_keys_p): (invalid_keyword_argument): New functions, called from the keyword argument parsing code. * data.c (init_errors_once_early): Add the new invalid-keyword-argument error here.
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 01 Mar 2010 21:05:33 +0000
parents 229bd619740a
children 1fae11d56ad2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
1 /* New allocator for XEmacs.
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
2 Copyright (C) 2005 Marcus Crestani.
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
3
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
4 This file is part of XEmacs.
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
5
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
9 later version.
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
10
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
14 for more details.
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
15
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
20
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
22
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
23 #ifndef INCLUDED_mc_alloc_h_
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
24 #define INCLUDED_mc_alloc_h_
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
25
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
26 /*--- prototypes -------------------------------------------------------*/
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
27
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
28 BEGIN_C_DECLS
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
29
3305
1043bbfa24cf [xemacs-hg @ 2006-03-26 15:24:25 by crestani]
crestani
parents: 3303
diff changeset
30 /* Set to 1 if memory becomes short. */
1043bbfa24cf [xemacs-hg @ 2006-03-26 15:24:25 by crestani]
crestani
parents: 3303
diff changeset
31 extern EMACS_INT memory_shortage;
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
32
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
33
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
34 /* Internal Allocator Functions: */
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
35
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
36 /* Initialize the allocator. This has to be called prior to
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
37 requesting memory. */
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
38 void init_mc_allocator (void);
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
39
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
40 /* Allocate a block of memory of given size and return the pointer to
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
41 it. */
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
42 void *mc_alloc (size_t size);
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
43
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
44 /* Allocate a block of memory as an array with elemcount elements of
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
45 given size and return the pointer to it. Arrays contain several
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
46 objects that are allocated in one consecutive block of memory with
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
47 each element being a fully qualified object---that is, it has a
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
48 Lisp object header and a mark bit. Objects like hash tables and
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
49 dynamic arrays use this function. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
50 void *mc_alloc_array (size_t size, EMACS_INT elemcount);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
51
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
52 /* Modify the size of the memory block pointed to by ptr. Return the
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
53 address of the new block of given size. The content of the memory
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
54 block will be unchanged to the minimum of the old and new sizes: if
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
55 the new size is smaller, the overlaying data is cut off; if the new
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
56 size is bigger, the newly allocated memory will be uninitialized.*/
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
57 void *mc_realloc (void *ptr, size_t size);
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
58
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
59 /* Modify the size of the array pointed to by ptr. Return the address
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
60 of the new array block with elemcount elements of given size. The
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
61 content of the memory block will be unchanged to the minimum of the
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
62 old and new sizes: if the new size is smaller, the overlaying data
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
63 is cut off; if the new size is bigger, the newly allocated memory
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
64 will be uninitialized.*/
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
65 void *mc_realloc_array (void *ptr, size_t size, EMACS_INT elemcount);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
66
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
67
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
68
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
69 /* Garbage collection related functions and macros: */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
70
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
71 enum mark_bit_colors
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
72 {
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
73 WHITE = 0,
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
74 BLACK = 1,
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
75 GREY = 2
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
76 };
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
77
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
78 /* Set the mark bit of the object pointed to by ptr to value.*/
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
79 void set_mark_bit (void *ptr, EMACS_INT value);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
80
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
81 /* Return the mark bit of the object pointed to by ptr. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
82 EMACS_INT get_mark_bit (void *ptr);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
83
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
84 /* mark bit macros */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
85 /* Returns true if the mark bit of the object pointed to by ptr is set. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
86 #define MARKED_P(ptr) (get_mark_bit (ptr) != WHITE)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
87
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
88 /* Marks the object pointed to by ptr (sets the mark bit to 1). */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
89 #define MARK(ptr) set_mark_bit (ptr, BLACK)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
90
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
91 /* Unmarks the object pointed to by ptr (sets the mark bit to 0). */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
92 #define UNMARK(ptr) set_mark_bit (ptr, WHITE)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
93
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
94 #define MARK_WHITE(ptr) set_mark_bit (ptr, WHITE)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
95 #define MARK_GREY(ptr) set_mark_bit (ptr, GREY)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
96 #define MARK_BLACK(ptr) set_mark_bit (ptr, BLACK)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
97
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
98 #define MARKED_WHITE_P(ptr) (get_mark_bit (ptr) == WHITE)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
99 #define MARKED_GREY_P(ptr) (get_mark_bit (ptr) == GREY)
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
100 #define MARKED_BLACK_P(ptr) (get_mark_bit (ptr) == BLACK)
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
101
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
102 /* The finalizer of every not marked object is called. The macro
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
103 MC_ALLOC_CALL_FINALIZER has to be defined and call the finalizer of
3303
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
104 the object. Returns number of processed pages. */
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
105 EMACS_INT mc_finalize (void);
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
106
3303
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
107 /* All not marked objects of the used heap are freed. Returns number
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
108 of processed pages. */
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
109 EMACS_INT mc_sweep (void);
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
110
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
111
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
112
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
113 /* Portable dumper related functions and macros: */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
114
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
115 /* The finalizer for disksave of every object is called to shrink the
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
116 dump image. The macro MC_ALLOC_CALL_FINALIZER_FOR_DISKSAVE has to
3303
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
117 be defined and call the finalizer for disksave of the object.
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
118 Returns number of processed pages. */
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
119 EMACS_INT mc_finalize_for_disksave (void);
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
120
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
121
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
122
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
123 /* Functions and macros related with allocation statistics: */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
124
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
125 #ifdef MEMORY_USAGE_STATS
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
126 /* Returns the real size, including overhead, which is actually alloced
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
127 for an object with given claimed_size. */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
128 Bytecount mc_alloced_storage_size (Bytecount claimed_size,
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
129 struct overhead_stats *stats);
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
130 #endif /* MEMORY_USAGE_STATS */
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
131
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
132
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
133 /* Incremental Garbage Collector / Write Barrier Support: */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
134
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
135 /* Return the PAGESIZE the allocator uses. Generally equals to the
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
136 system's PAGESIZE. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
137 EMACS_INT mc_get_page_size (void);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
138
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
139 /* Is the fault at ptr on a protected page? */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
140 EMACS_INT fault_on_protected_page (void *ptr);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
141
3303
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
142 /* Remove protection (if there) of heap page of given page header ph.
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
143 Returns number of processed pages. */
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
144 EMACS_INT protect_heap_pages (void);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
145
3303
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
146 /* Remove protection for all heap pages which are protected. Returns
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
147 number of processed pages. */
619edf713d55 [xemacs-hg @ 2006-03-26 14:05:29 by crestani]
crestani
parents: 3263
diff changeset
148 EMACS_INT unprotect_heap_pages (void);
3092
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
149
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
150 /* Remove protection and mark page dirty. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
151 void unprotect_page_and_mark_dirty (void *ptr);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
152
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
153 /* Repush all objects on dirty pages onto the mark stack. Return
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
154 number of repushed objects. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
155 int repush_all_objects_on_page (void *ptr);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
156
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
157 /* Mark black if object is currently grey. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
158 EMACS_INT maybe_mark_black (void *ptr);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
159
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
160 /* Only for debugging---not used anywhere in the sources. */
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
161 EMACS_INT object_on_heap_p (void *ptr);
141c2920ea48 [xemacs-hg @ 2005-11-25 01:41:31 by crestani]
crestani
parents: 2994
diff changeset
162
2720
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
163 END_C_DECLS
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
164
6fa9919a9a0b [xemacs-hg @ 2005-04-08 23:10:01 by crestani]
crestani
parents:
diff changeset
165 #endif /* INCLUDED_mc_alloc_h_ */