History log of /haiku/src/system/boot/loader/heap.cpp
Revision Date Author Comments
# 986199c9 19-Oct-2021 Augustin Cavalier <waddlesplash@gmail.com>

boot: Add calloc() implementation to bootloader heap.

Needed by zstd.


# baca34be 30-Dec-2020 PulkoMandy <pulkomandy@pulkomandy.tk>

bootloader heap: more detailed errors on out-of-memory

It's hard enough to debug bootloader code already, let's gather as much
info as we can from error messages.

Change-Id: I47dff402286625d1213caa36ae6ee8ecf707dfad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3574
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 9703c9cc 26-Oct-2013 François Revol <revol@free.fr>

bootloader: Add tracing to malloc_large()


# a3a4302b 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader heap: Handle large allocations separately

Use platform_{allocate,free}_region() to allocate/free chunks >= 16 KiB.
This reduces the usage of our dedicated (and limited) heap region,
particularly since packagefs makes some larger temporary allocations
while reading the package file. Should fix #10136.


# 0262f55a 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader heap: Remove left over debug variables


# ea4f2ac2 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Optimize heap implementation

* Increase general allocation alignment from 4 to 8 byte. That was even
incorrect.
* Use a splay tree instead of a singly linked list to manage the free
chunks. That increases the size of the per-chunk structure to manage
the free chunks, i.e. the of minimally allocatable memory size (from
align(sizeof(void*)) to align(3 * sizeof(void*))), but make finding
and inserting chunks much faster.

Fixes #10063 respectively improves the situation significantly.


# 4b723e3f 06-May-2013 Axel Dörfler <axeld@pinc-software.de>

boot loader: Almost removed use of kernel_cpp.h.

* For some reason that is beyond me, fat/CachedBlock.cpp needs this header,
or else building the boot loader fails.


# 00090d29 08-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: print max heap usage info before entering kernel


# a173514a 10-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Revert hrev43459.

This reverts commit c8a48d783c78e1e39c06a102e877d954923f6038.


# c8a48d78 10-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Same as hrev43457 (- the error) but for the bootloader heap.


# 7cab82a1 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34415 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 943bec12 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Made a class out of free_chunk.
* Fixed realloc() - "size" wasn't what I thought it would be.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34412 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c627a27 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Reimplemented realloc() to reuse the previous buffer if possible and useful.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5a150dfe 21-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional tracing for allocations.
* Lifted hard-coded 64 KB heap limit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27679 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cc3b6f3a 21-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc() now also logs an error when a request could not be served.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96689a5c 27-Dec-2007 Axel Dörfler <axeld@pinc-software.de>

* If DEBUG_ALLOCATIONS is defined, freed memory is now filled with 0xcc,
and it's checked if a chunk is already in the free list, and if any chunk
has an invalid size. It's defined for now.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23171 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9d577c10 27-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed realloc(). Supplying a NULL pointer crashed. Furthermore, a size
argument value of 0 should only free the old allocation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15688 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5af32e75 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed src/kernel to src/system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12359 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9703c9cc30cc47c2488a190a93b9603c08f368ca 26-Oct-2013 François Revol <revol@free.fr>

bootloader: Add tracing to malloc_large()


# a3a4302beab717986b2f9686b7764ed7410c7075 25-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader heap: Handle large allocations separately

Use platform_{allocate,free}_region() to allocate/free chunks >= 16 KiB.
This reduces the usage of our dedicated (and limited) heap region,
particularly since packagefs makes some larger temporary allocations
while reading the package file. Should fix #10136.


# 0262f55a51dbd24f96b4577023c34cfa3cb48847 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader heap: Remove left over debug variables


# ea4f2ac2dcfed69600d74c9d4b1e57cb3445b47d 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: Optimize heap implementation

* Increase general allocation alignment from 4 to 8 byte. That was even
incorrect.
* Use a splay tree instead of a singly linked list to manage the free
chunks. That increases the size of the per-chunk structure to manage
the free chunks, i.e. the of minimally allocatable memory size (from
align(sizeof(void*)) to align(3 * sizeof(void*))), but make finding
and inserting chunks much faster.

Fixes #10063 respectively improves the situation significantly.


# 4b723e3fb86ecc8027728c6c26d782964419f573 06-May-2013 Axel Dörfler <axeld@pinc-software.de>

boot loader: Almost removed use of kernel_cpp.h.

* For some reason that is beyond me, fat/CachedBlock.cpp needs this header,
or else building the boot loader fails.


# 00090d290d61b06dc60dc91e2b4d9f90f638dd22 08-May-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: print max heap usage info before entering kernel


# a173514ad17cfabf540ceaa07d15cea41eb91f79 10-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Revert hrev43459.

This reverts commit c8a48d783c78e1e39c06a102e877d954923f6038.


# c8a48d783c78e1e39c06a102e877d954923f6038 10-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Same as hrev43457 (- the error) but for the bootloader heap.


# 7cab82a1c90f893d33aaebcbea2b47bb8cd232e6 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34415 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 943bec1287603f790edd92afee04eb3ed3557a3c 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Made a class out of free_chunk.
* Fixed realloc() - "size" wasn't what I thought it would be.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34412 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c627a2751d4d0746523155cb280729174b448bb 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Reimplemented realloc() to reuse the previous buffer if possible and useful.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5a150dfe6d9f54a23dc03d89089194b08f214314 21-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added optional tracing for allocations.
* Lifted hard-coded 64 KB heap limit.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27679 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cc3b6f3a05b882a507d39a83a4fcc8280d3ecb42 21-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc() now also logs an error when a request could not be served.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27677 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 96689a5cb87b4ac360fbf4b8ad299690f6c60f4b 27-Dec-2007 Axel Dörfler <axeld@pinc-software.de>

* If DEBUG_ALLOCATIONS is defined, freed memory is now filled with 0xcc,
and it's checked if a chunk is already in the free list, and if any chunk
has an invalid size. It's defined for now.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23171 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9d577c1064758145e1de5072afb86b0294e6f8ff 27-Dec-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed realloc(). Supplying a NULL pointer crashed. Furthermore, a size
argument value of 0 should only free the old allocation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15688 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5af32e752606778be5dd7379f319fe43cb3f6b8c 13-Apr-2005 Axel Dörfler <axeld@pinc-software.de>

Renamed src/kernel to src/system.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12359 a95241bf-73f2-0310-859d-f6bbb57e9c96