Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#3582 assigned task

Remove dedicated support for boundary constraint in heap allocator

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: Indefinite
Component: score Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Some time ago a dedicated support for a boundary constraint was added to the first fit heap allocator. The use case for this is the libbsd (new network stack) which needs this for the bus space allocator:

https://www.freebsd.org/cgi/man.cgi?query=bus_dma

It turned out that this feature is rarely used. It makes the first fit heap allocator implementation considerably more complex. It is also not a standard allocator feature which makes it more difficult to replace the first fit heap allocator with something else, e.g. TLSF.

The boundary constraint can be also satisfied by an allocator which supports only the alignment constraint via:

if (boundary > alignment) {
	assert(alignment == 0 || boundary % alignment == 0);
	alignment = boundary;
}

Change History (5)

comment:1 Changed on 12/19/19 at 08:07:34 by Sebastian Huber

Milestone: 5.16.1

comment:2 Changed on 06/14/22 at 06:46:19 by Chris Johns

TLSF provides tlsf_memalign(). I think this ticket can be closed and the requirement for an aligned allocation call for any new allocators be made.

comment:3 Changed on 06/14/22 at 06:46:52 by Chris Johns

Milestone: 6.1Indefinite
Version: 5

comment:4 Changed on 06/20/22 at 05:51:24 by Sebastian Huber

This ticket refers to the first fit allocator. Removing the boundary support would simplify the implementation a bit. We should replace the first fit allocator with TLSF, so this ticket is probably obsolete.

comment:5 in reply to:  4 Changed on 06/20/22 at 07:41:33 by Chris Johns

Replying to Sebastian Huber:

This ticket refers to the first fit allocator. Removing the boundary support would simplify the implementation a bit. We should replace the first fit allocator with TLSF, so this ticket is probably obsolete.

I agree and thanks and that was my view. Please close if you think it would be covered in the other ticket.

Note: See TracTickets for help on using tickets.