History log of /haiku-fatelf/src/system/kernel/guarded_heap.cpp
Revision Date Author Comments
# 5e5eef0b 06-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Fix the page need calculation, it was possibly off by one.


# 336967aa 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Add more debugger commands to closer inspect the guarded heap.


# 4a7b4820 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Try smaller sizes if creating an area failed.

Depending on the use case the grow size may be too large to fit into
address space holes. Instead of failing try with smaller sizes until
it either worked or doesn't make sense anymore (< 1MB).


# 01eb710a 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Use a free list to make the guarded heap perform less horribly.

Pages that are freed are added to the tail of the list while allocation
candidates are taken from the head. Therefore pages that have been free
the longest are preferred, making immediate re-use less likely.

Also avoid looking for pages if the free count already tells that the
allocation can't be fulfilled.


# 5cbe06f4 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Allow replacing the object cache with the guarded heap.

This allows to use the debug features of the guarded heap also on
allocations made through the object cache API. This is obivously
horrible for performance and uses up huge amounts of memory, so the
initial and grow sizes are adjusted accordingly.

Note that this is a rather simple hack, using the object_cache pointer
to transport the allocation size. The alignment is neglected completely.


# 390a6e2e 03-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Add support for optional inline stack traces in guarded heap.


# 1fe24d0c 03-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Add heap with guard pages to detect out of bound reads/writes.

This is a very simple heap implementation that allocates memory so that
the end of each allocation always coincides with a page end and is
followed by a guard page which is marked non-present. Out of bounds
access (both read and write) therefore cause a crash (unhandled page
fault).

Note that this allocator is neither speed nor space efficient, indeed it
wastes huge amounts of pages and address space so it is quite easy to
hit limits. It is intended as a pure debug feature.


# 5e5eef0b5bf3d6e88a3c5d1cde24d254209a88b6 06-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Fix the page need calculation, it was possibly off by one.


# 336967aafdc50b8a46e50a20d596beb8e9f65613 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Add more debugger commands to closer inspect the guarded heap.


# 4a7b48203e5597f3830ecb8e68a26b157ba97e5b 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Try smaller sizes if creating an area failed.

Depending on the use case the grow size may be too large to fit into
address space holes. Instead of failing try with smaller sizes until
it either worked or doesn't make sense anymore (< 1MB).


# 01eb710a9153406a2ce2be08c00a01d56f7737e3 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Use a free list to make the guarded heap perform less horribly.

Pages that are freed are added to the tail of the list while allocation
candidates are taken from the head. Therefore pages that have been free
the longest are preferred, making immediate re-use less likely.

Also avoid looking for pages if the free count already tells that the
allocation can't be fulfilled.


# 5cbe06f482858c8b79671927e887ab08375a721c 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Allow replacing the object cache with the guarded heap.

This allows to use the debug features of the guarded heap also on
allocations made through the object cache API. This is obivously
horrible for performance and uses up huge amounts of memory, so the
initial and grow sizes are adjusted accordingly.

Note that this is a rather simple hack, using the object_cache pointer
to transport the allocation size. The alignment is neglected completely.


# 390a6e2e0238112a68521b3b9210e1dbf98f9d47 03-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Add support for optional inline stack traces in guarded heap.


# 1fe24d0cd0b547a771c00f6fca8f50ba6ca2fb2c 03-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Add heap with guard pages to detect out of bound reads/writes.

This is a very simple heap implementation that allocates memory so that
the end of each allocation always coincides with a page end and is
followed by a guard page which is marked non-present. Out of bounds
access (both read and write) therefore cause a crash (unhandled page
fault).

Note that this allocator is neither speed nor space efficient, indeed it
wastes huge amounts of pages and address space so it is quite easy to
hit limits. It is intended as a pure debug feature.