|
|
От: |
Lazy Cjow Rhrr
|
lj://_lcr_ |
| Дата: | 09.12.05 09:19 | ||
| Оценка: | |||
The allocator implemented by Loki has a four-layered architecture. The first layer consists of a
private type Chunk, which deals with organizing memory chunks in equally sized blocks. The
second layer is FixedAllocator, which uses a variable-length vector of chunks to satisfy
memory allocation to the extent of the available memory in the system. In the third layer,
SmallObjAllocator uses multiple FixedAllocator objects to provide allocations of any
object size. Small objects are allocated using a FixedAllocator, and requests for large objects
are forwarded to ::operator new. Finally, the fourth layer consists of SmallObject, a class
template that wraps a SmallObjAllocator object.
quicksort =: (($:@(<#[),(=#[),$:@(>#[)) ({~ ?@#)) ^: (1<#)