diff options
Diffstat (limited to 'src/microhttpd/memorypool.c')
-rw-r--r-- | src/microhttpd/memorypool.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c index 4d619464..a979c64a 100644 --- a/src/microhttpd/memorypool.c +++ b/src/microhttpd/memorypool.c | |||
@@ -98,6 +98,7 @@ MHD_init_mem_pools_ (void) | |||
98 | #else | 98 | #else |
99 | MHD_sys_page_size_ = MHD_DEF_PAGE_SIZE_; | 99 | MHD_sys_page_size_ = MHD_DEF_PAGE_SIZE_; |
100 | #endif /* _WIN32 */ | 100 | #endif /* _WIN32 */ |
101 | mhd_assert (0 == (MHD_sys_page_size_ % ALIGN_SIZE)); | ||
101 | } | 102 | } |
102 | 103 | ||
103 | 104 | ||
@@ -147,6 +148,7 @@ MHD_pool_create (size_t max) | |||
147 | struct MemoryPool *pool; | 148 | struct MemoryPool *pool; |
148 | size_t alloc_size; | 149 | size_t alloc_size; |
149 | 150 | ||
151 | mhd_assert (max > 0); | ||
150 | pool = malloc (sizeof (struct MemoryPool)); | 152 | pool = malloc (sizeof (struct MemoryPool)); |
151 | if (NULL == pool) | 153 | if (NULL == pool) |
152 | return NULL; | 154 | return NULL; |
@@ -195,6 +197,7 @@ MHD_pool_create (size_t max) | |||
195 | pool->is_mmap = true; | 197 | pool->is_mmap = true; |
196 | } | 198 | } |
197 | #endif /* _WIN32 || MAP_ANONYMOUS */ | 199 | #endif /* _WIN32 || MAP_ANONYMOUS */ |
200 | mhd_assert (0 == (((uintptr_t) pool->memory) % ALIGN_SIZE)); | ||
198 | pool->pos = 0; | 201 | pool->pos = 0; |
199 | pool->end = alloc_size; | 202 | pool->end = alloc_size; |
200 | pool->size = alloc_size; | 203 | pool->size = alloc_size; |