| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Allocate a large span of length == n. If successful, returns a | 209 // Allocate a large span of length == n. If successful, returns a |
| 210 // span of exactly the specified length. Else, returns NULL. | 210 // span of exactly the specified length. Else, returns NULL. |
| 211 Span* AllocLarge(Length n); | 211 Span* AllocLarge(Length n); |
| 212 | 212 |
| 213 // Commit the span. | 213 // Commit the span. |
| 214 void CommitSpan(Span* span); | 214 void CommitSpan(Span* span); |
| 215 | 215 |
| 216 // Decommit the span. |
| 217 void DecommitSpan(Span* span); |
| 218 |
| 216 // Incrementally release some memory to the system. | 219 // Incrementally release some memory to the system. |
| 217 // IncrementalScavenge(n) is called whenever n pages are freed. | 220 // IncrementalScavenge(n) is called whenever n pages are freed. |
| 218 void IncrementalScavenge(Length n); | 221 void IncrementalScavenge(Length n); |
| 219 | 222 |
| 220 // Number of pages to deallocate before doing more scavenging | 223 // Number of pages to deallocate before doing more scavenging |
| 221 int64_t scavenge_counter_; | 224 int64_t scavenge_counter_; |
| 222 | 225 |
| 223 // Index of last free list we scavenged | 226 // Index of last free list we scavenged |
| 224 int scavenge_index_; | 227 int scavenge_index_; |
| 225 }; | 228 }; |
| 226 | 229 |
| 227 } // namespace tcmalloc | 230 } // namespace tcmalloc |
| 228 | 231 |
| 229 #endif // TCMALLOC_PAGE_HEAP_H_ | 232 #endif // TCMALLOC_PAGE_HEAP_H_ |
| OLD | NEW |