6. Try to group dynamic allocations

If dynamic allocation is mandatory, try to group similar allocations and frees together. Ideally, an allocation of a buffer is followed by freeing it before another allocation happens. This rarely can be done in practice, but combining a group of related allocations is often nearly as effective.

Again, allocations and frees should be replaced whenever possible. Grouping them is a last resort.