Philipp Oppermann
e5d10fcaec
Increase stack size to avoid stack overflow
2020-01-23 10:41:59 +01:00
Philipp Oppermann
e1242a867f
Move global_asm inline in threads module
2020-01-23 09:20:17 +01:00
Philipp Oppermann
cd138a3a1b
Rename multitasking module to threads
2020-01-23 09:19:38 +01:00
Philipp Oppermann
11a0eb679c
Fix race condition
...
The first timer interrupt might occur before the heap is initialized. With lazy_static, this causes an allocation failure since the VecDeque is allocated when it's accessed the first time. This commit fixes this by only initializing VecDeque in `add_thread`.
2020-01-23 08:50:35 +01:00
Philipp Oppermann
241c1ab2c9
Add support for closures
2020-01-23 08:24:48 +01:00
Philipp Oppermann
b75406b37e
Add new modules
2020-01-22 17:24:17 +01:00
Philipp Oppermann
c3450b6df7
Refactor a bit
2020-01-22 16:33:23 +01:00
Philipp Oppermann
ce1fdcf768
Wip
2020-01-22 16:15:23 +01:00
Philipp Oppermann
002d6f255f
Set FixedSizeBlockAllocator as global allocator
2020-01-20 14:09:00 +01:00
Philipp Oppermann
6c3bf0b10f
Implement GlobalAlloc::dealloc
2020-01-20 14:07:47 +01:00
Philipp Oppermann
7a792f5cb0
Implement GlobalAlloc::alloc
2020-01-20 14:07:02 +01:00
Philipp Oppermann
93b4dcf434
Add skeleton for GlobalAlloc implementation
2020-01-20 14:06:26 +01:00
Philipp Oppermann
821dd2adb4
Add function to calculate the list index
2020-01-20 14:05:24 +01:00
Philipp Oppermann
d636939b51
Add FixedSizeBlockAllocator::fallback_alloc method
2020-01-20 14:05:01 +01:00
Philipp Oppermann
9b7326541e
Add FixedSizeBlockAllocator type
2020-01-20 14:04:13 +01:00
Philipp Oppermann
4f234b67ef
Add ListNode type and BLOCK_SIZES constant
2020-01-20 14:02:57 +01:00
Philipp Oppermann
7381e11f3c
Create a new fixed_size_block allocator submodule
2020-01-20 14:01:59 +01:00
Philipp Oppermann
a9fe65a0ce
Use new LinkedListAllocator
2020-01-10 13:04:46 +01:00
Philipp Oppermann
2001814119
Implement LinkedListAllocator::size_align
2020-01-10 13:00:16 +01:00
Philipp Oppermann
a5c50e7408
Implement GlobalAlloc for LinkedListAllocator
2020-01-10 11:52:04 +01:00
Philipp Oppermann
70a52c291d
Implement alloc_from_region
2020-01-10 11:48:56 +01:00
Philipp Oppermann
c56bfa27e4
Implement find_region
2020-01-10 11:46:10 +01:00
Philipp Oppermann
55aec9ebf3
Apply rustfmt to ListNode::new function
2020-01-10 11:44:38 +01:00
Philipp Oppermann
2e1d132a9a
Implement add_free_region
2020-01-10 11:44:17 +01:00
Philipp Oppermann
63e8577d77
Create a basic LinkedListAllocator type
2020-01-10 11:42:04 +01:00
Philipp Oppermann
75d826bf69
Add a test that memory is reused with a long lived allocation
...
This test fails for the bump allocator because it can only free the complete heap at once, which is prevented by the single long-lived allocation.
2020-01-09 15:45:38 +01:00
Philipp Oppermann
45be3f0648
Use our BumpAllocator instead of linked_list_allocator crate
2020-01-09 15:37:43 +01:00
Philipp Oppermann
055c560a7a
Add an align_up function
2020-01-09 15:36:06 +01:00
Philipp Oppermann
e87044a7ee
Implement GlobalAlloc for BumpAllocator
2020-01-09 15:35:03 +01:00
Philipp Oppermann
08d2289dad
Add a Locked wrapper type that can be used to implement GlobalAlloc
2020-01-09 15:34:04 +01:00
Philipp Oppermann
7c84dbaa1d
Create a basic BumpAllocator type
2020-01-09 15:25:37 +01:00
Philipp Oppermann
882c83f9de
Update many_boxes test to scale with heap size ( #716 )
...
Instead of using a hardcoded number of boxes, use the HEAP_SIZE constant. This ensures that we get a test failure because of an out-of-memory error when the allocator does not reuse freed memory.
2020-01-09 12:58:29 +01:00
Philipp Oppermann
869a69e531
Move #[global_allocator] into allocator module ( #714 )
...
The Rust issue that the #[global_allocator] cannot be defined in submodules was fixed.
2020-01-08 12:38:06 +01:00
Philipp Oppermann
817267e51c
Update Github Actions badge for post-10
2019-12-12 09:32:59 +01:00
Philipp Oppermann
9e75078dab
Merge branch 'post-09' into post-10
2019-12-12 09:32:46 +01:00
Philipp Oppermann
ed3af8e984
Update Github Actions badge for post-09
2019-12-12 09:32:30 +01:00
Philipp Oppermann
1d1075b35e
Merge branch 'post-08' into post-09
2019-12-12 09:32:16 +01:00
Philipp Oppermann
00f39aaccb
Update Github Actions badge for post-08
2019-12-12 09:31:56 +01:00
Philipp Oppermann
f815a1742a
Merge branch 'post-07' into post-08
2019-12-12 09:31:42 +01:00
Philipp Oppermann
2bf70751bf
Update Github Actions badge for post-07
2019-12-12 09:31:24 +01:00
Philipp Oppermann
ad2590068d
Merge branch 'post-06' into post-07
2019-12-12 09:31:07 +01:00
Philipp Oppermann
c211412ce2
Update Github Actions badge for post-06
2019-12-12 09:30:51 +01:00
Philipp Oppermann
93d3de6feb
Merge branch 'post-05' into post-06
2019-12-12 09:30:37 +01:00
Philipp Oppermann
6dcf5c61fb
Update Github Actions badge for post-05
2019-12-12 09:30:17 +01:00
Philipp Oppermann
96683c596b
Merge branch 'post-04' into post-05
2019-12-12 09:30:03 +01:00
Philipp Oppermann
029d6bee78
Update Github Actions badge for post-04
2019-12-12 09:29:31 +01:00
Philipp Oppermann
0fc6fedd82
Merge branch 'post-03' into post-04
2019-12-12 09:29:14 +01:00
Philipp Oppermann
0489c09d05
Update Github Actions badge for post-03
2019-12-12 09:28:56 +01:00
Philipp Oppermann
99b139ddff
Merge branch 'post-02' into post-03
2019-12-12 09:28:44 +01:00
Philipp Oppermann
fea4fa9c67
Update Github Actions badge for post-02
2019-12-12 09:28:05 +01:00