| Ada 95 Quality and Style Guide | Chapter 7 |
7.3.3 Storage Pool Mechanismsguideline
Consider using explicitly defined storage pool mechanisms. example
See the Rationale (1995, §13.4) for an example of the use of storage pools.
rationale
There are several alternatives to consider when deciding what storage management technique to use. You should choose as simple a technique as possible that still satisfies your application requirements.
You can use allocators and unchecked deallocation as is. Note that the degree to which explicitly deallocated storage is reclaimed might vary across implementations (Ada Reference Manual 1995, §13.11.2).
You use allocators as before. Instead of using unchecked deallocation, you maintain your own free lists of objects that are no longer in use and available for reuse.
You use allocators and possibly unchecked deallocation; however, you implement a storage pool and associate it with the access type(s) via a Storage_Pool clause. You can use this technique to implement a mark/release storage management paradigm, which might be significantly faster than an allocate/deallocate paradigm. Some vendors may provide a mark/release package as part of their Ada environment.
You do not use allocators, but instead use unchecked conversion from the address and do all your own default initialization, etc. It is unlikely you would use this last option because you lose automatic default initialization.
| < Previous Page | Search | Contents | Index | Next Page > |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| TOC | TOC | TOC | TOC | TOC | TOC | TOC | TOC | TOC | TOC | TOC |
| Appendix | References | Bibliography |