Rev | Line | |
---|
[176] | 1 | // -*- C++ -*- |
---|
| 2 | |
---|
| 3 | #ifndef _MMAPALLOC_H_ |
---|
| 4 | #define _MMAPALLOC_H_ |
---|
| 5 | |
---|
| 6 | #include <stdio.h> |
---|
| 7 | |
---|
| 8 | #include "mmapwrapper.h" |
---|
| 9 | |
---|
| 10 | /** |
---|
| 11 | * @class MmapAlloc |
---|
| 12 | * @brief Obtains memory from Mmap but doesn't allow it to be freed. |
---|
| 13 | * @author Emery Berger <http://www.cs.umass.edu/~emery> |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | namespace Hoard { |
---|
| 17 | |
---|
| 18 | class MmapAlloc { |
---|
| 19 | public: |
---|
| 20 | void * malloc (size_t sz) { |
---|
| 21 | void * ptr = HL::MmapWrapper::map (sz); |
---|
| 22 | return ptr; |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | }; |
---|
| 26 | |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.