Skip to content

Commit 8bfa1a7

Browse files
committed
use 1 slot for all extended size classes
This reduces memory usage and improves security in combination with the guard slab feature.
1 parent 3952645 commit 8bfa1a7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,10 @@ retaining the isolation.
589589

590590
| size class | worst case internal fragmentation | slab slots | slab size | internal fragmentation for slabs |
591591
| - | - | - | - | - |
592-
| 20480 | 20.0% | 2 | 40960 | 0.0% |
593-
| 24576 | 16.66% | 2 | 49152 | 0.0% |
594-
| 28672 | 14.28% | 2 | 57344 | 0.0% |
595-
| 32768 | 12.5% | 2 | 65536 | 0.0% |
592+
| 20480 | 20.0% | 1 | 20480 | 0.0% |
593+
| 24576 | 16.66% | 1 | 24576 | 0.0% |
594+
| 28672 | 14.28% | 1 | 28672 | 0.0% |
595+
| 32768 | 12.5% | 1 | 32768 | 0.0% |
596596
| 40960 | 20.0% | 1 | 40960 | 0.0% |
597597
| 49152 | 16.66% | 1 | 49152 | 0.0% |
598598
| 57344 | 14.28% | 1 | 57344 | 0.0% |

h_malloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static const u16 size_class_slots[] = {
144144
/* 1024 */ 8, 8, 8, 8,
145145
/* 2048 */ 6, 5, 4, 4,
146146
#if CONFIG_EXTENDED_SIZE_CLASSES
147-
/* 4096 */ 2, 2, 2, 2,
147+
/* 4096 */ 1, 1, 1, 1,
148148
/* 8192 */ 1, 1, 1, 1,
149149
/* 16384 */ 1, 1, 1, 1,
150150
#endif

0 commit comments

Comments
 (0)