Changeset 3720 for branches/libc-0.6
- Timestamp:
- Mar 17, 2011, 10:19:43 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/src/lib/malloc/ialloc.c
r1457 r3720 246 246 247 247 /* Attempt to expand the heap to enable allocation of a lump of SIZE 248 bytes. Return true iff successful. */ 249 250 static int _um_heap_expand (Heap_t h, size_t size) 248 bytes suitable for an ALIGN aligned allocation. 249 Return true iff successful. */ 250 251 static int _um_heap_expand (Heap_t h, size_t size, size_t align) 251 252 { 252 253 size_t rsize, add_size; … … 259 260 return 0; 260 261 261 rsize = _UM_ROUND_LUMP (size); 262 if (align < _UM_PAGE_SIZE / 2) 263 rsize = _UM_ROUND_LUMP (size); 264 else 265 rsize = _UM_ROUND_LUMP (size + align + align / 2); 262 266 if (rsize >= _UM_MAX_SIZE) 263 267 return 0; … … 292 296 if (block != NULL) 293 297 return block; 294 if (!_um_heap_expand (h, size ))298 if (!_um_heap_expand (h, size, align)) 295 299 return NULL; 296 300
Note:
See TracChangeset
for help on using the changeset viewer.