|
Lines 67-72
Link Here
|
| 67 |
struct mm_master * |
67 |
struct mm_master * |
| 68 |
mm_create(struct mm_master *mmalloc, size_t size) |
68 |
mm_create(struct mm_master *mmalloc, size_t size) |
| 69 |
{ |
69 |
{ |
|
|
70 |
#ifdef HAVE_MMAP |
| 70 |
void *address; |
71 |
void *address; |
| 71 |
struct mm_master *mm; |
72 |
struct mm_master *mm; |
| 72 |
|
73 |
|
|
Lines 96-101
Link Here
|
| 96 |
mm_make_entry(mm, &mm->rb_free, address, size); |
97 |
mm_make_entry(mm, &mm->rb_free, address, size); |
| 97 |
|
98 |
|
| 98 |
return (mm); |
99 |
return (mm); |
|
|
100 |
#else |
| 101 |
fatal("Privsep should be turned off on your platform due to lack of mmap"); |
| 102 |
|
| 103 |
/* NOTREACHED */ |
| 104 |
return NULL; |
| 105 |
#endif |
| 99 |
} |
106 |
} |
| 100 |
|
107 |
|
| 101 |
/* Frees either the allocated or the free list */ |
108 |
/* Frees either the allocated or the free list */ |
|
Lines 120-125
Link Here
|
| 120 |
void |
127 |
void |
| 121 |
mm_destroy(struct mm_master *mm) |
128 |
mm_destroy(struct mm_master *mm) |
| 122 |
{ |
129 |
{ |
|
|
130 |
#ifdef HAVE_MMAP |
| 123 |
mm_freelist(mm->mmalloc, &mm->rb_free); |
131 |
mm_freelist(mm->mmalloc, &mm->rb_free); |
| 124 |
mm_freelist(mm->mmalloc, &mm->rb_allocated); |
132 |
mm_freelist(mm->mmalloc, &mm->rb_allocated); |
| 125 |
|
133 |
|
|
Lines 129-134
Link Here
|
| 129 |
xfree(mm); |
137 |
xfree(mm); |
| 130 |
else |
138 |
else |
| 131 |
mm_free(mm->mmalloc, mm); |
139 |
mm_free(mm->mmalloc, mm); |
|
|
140 |
#endif |
| 132 |
} |
141 |
} |
| 133 |
|
142 |
|
| 134 |
void * |
143 |
void * |