Skip to content

Commit d2ecbe9

Browse files
committed
Make UMF_COARSE_MEMORY_STRATEGY_FASTEST_BUT_ONE the default strategy
Make UMF_COARSE_MEMORY_STRATEGY_FASTEST_BUT_ONE the default strategy, because the alignment never equals 0 now. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 4b09af0 commit d2ecbe9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/coarse/coarse.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ typedef struct coarse_callbacks_t {
3434

3535
// coarse library allocation strategy
3636
typedef enum coarse_strategy_t {
37+
// Check if the first free block of the 'size' size has the correct alignment.
38+
// If not, use the `UMF_COARSE_MEMORY_STRATEGY_FASTEST` strategy.
39+
UMF_COARSE_MEMORY_STRATEGY_FASTEST_BUT_ONE = 0,
40+
3741
// Always allocate a free block of the (size + alignment) size
3842
// and cut out the properly aligned part leaving two remaining parts.
3943
// It is the fastest strategy but causes memory fragmentation
4044
// when alignment is greater than 0.
4145
// It is the best strategy when alignment always equals 0.
42-
UMF_COARSE_MEMORY_STRATEGY_FASTEST = 0,
43-
44-
// Check if the first free block of the 'size' size has the correct alignment.
45-
// If not, use the `UMF_COARSE_MEMORY_STRATEGY_FASTEST` strategy.
46-
UMF_COARSE_MEMORY_STRATEGY_FASTEST_BUT_ONE,
46+
UMF_COARSE_MEMORY_STRATEGY_FASTEST,
4747

4848
// Look through all free blocks of the 'size' size
4949
// and choose the first one with the correct alignment.

0 commit comments

Comments
 (0)