Handmade Hero»Episode Guide
Basic General Purpose Allocation
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
00:00:13Recap and plan for the day
00:00:13Recap and plan for the day
00:00:13Recap and plan for the day
00:01:54Plan for today: Writing our own general-purpose memory allocator
00:01:54Plan for today: Writing our own general-purpose memory allocator
00:01:54Plan for today: Writing our own general-purpose memory allocator
00:04:12Ode to stack memory allocation
00:04:12Ode to stack memory allocation
00:04:12Ode to stack memory allocation
00:05:33The asset system needs a more sophisticated memory allocator
00:05:33The asset system needs a more sophisticated memory allocator
00:05:33The asset system needs a more sophisticated memory allocator
00:06:45Closer look at asset eviction and memory fragmentation (blackboard)
00:06:45Closer look at asset eviction and memory fragmentation (blackboard)
00:06:45Closer look at asset eviction and memory fragmentation (blackboard)
00:10:41Overview of our approach
00:10:41Overview of our approach
00:10:41Overview of our approach
00:13:01Thinking of our available memory in terms of free fragments
00:13:01Thinking of our available memory in terms of free fragments
00:13:01Thinking of our available memory in terms of free fragments
00:14:25Merging contiguous free blocks
00:14:25Merging contiguous free blocks
00:14:25Merging contiguous free blocks
00:16:12We won't be performing small allocations
00:16:12We won't be performing small allocations
00:16:12We won't be performing small allocations
00:16:50Every block will keep information of neighboring blocks
00:16:50Every block will keep information of neighboring blocks
00:16:50Every block will keep information of neighboring blocks
00:18:43A possible way of implementing the allocation operation
00:18:43A possible way of implementing the allocation operation
00:18:43A possible way of implementing the allocation operation
00:24:12We can call EvictAssetsAsNecessary from inside AcquireAssetMemory!
00:24:12We can call EvictAssetsAsNecessary from inside AcquireAssetMemory!
00:24:12We can call EvictAssetsAsNecessary from inside AcquireAssetMemory!
00:28:44Modifying AcquireAssetMemory to work with our own memory
00:28:44Modifying AcquireAssetMemory to work with our own memory
00:28:44Modifying AcquireAssetMemory to work with our own memory
00:36:08Evicting assets to make room for a new one
00:36:08Evicting assets to make room for a new one
00:36:08Evicting assets to make room for a new one
00:37:19Keeping track of the location of our assets
00:37:19Keeping track of the location of our assets
00:37:19Keeping track of the location of our assets
00:40:46Doubly linked list of memory blocks
00:40:46Doubly linked list of memory blocks
00:40:46Doubly linked list of memory blocks
00:50:12FindBlockForSize
00:50:12FindBlockForSize
00:50:12FindBlockForSize
00:52:26Conditionally splitting the memory block used to store an asset as a function of its remaining capacity
00:52:26Conditionally splitting the memory block used to store an asset as a function of its remaining capacity
00:52:26Conditionally splitting the memory block used to store an asset as a function of its remaining capacity
00:56:35Recovering memory blocks inside ReleaseAssetMemory
00:56:35Recovering memory blocks inside ReleaseAssetMemory
00:56:35Recovering memory blocks inside ReleaseAssetMemory
00:58:15Q&A
🗩
00:58:15Q&A
🗩
00:58:15Q&A
🗩
00:59:40jameswidman Given that this is an optimization problem, it seems like we'll want to have a system for profiling asset use and eviction (and check its output periodically as the game and assets grow over the next year or so). Should this be on the agenda in the near term?
🗪
00:59:40jameswidman Given that this is an optimization problem, it seems like we'll want to have a system for profiling asset use and eviction (and check its output periodically as the game and assets grow over the next year or so). Should this be on the agenda in the near term?
🗪
00:59:40jameswidman Given that this is an optimization problem, it seems like we'll want to have a system for profiling asset use and eviction (and check its output periodically as the game and assets grow over the next year or so). Should this be on the agenda in the near term?
🗪
01:01:13graeme7 I'm not clear on what happens in the else when we fail to find a block, could you go over it?
🗪
01:01:13graeme7 I'm not clear on what happens in the else when we fail to find a block, could you go over it?
🗪
01:01:13graeme7 I'm not clear on what happens in the else when we fail to find a block, could you go over it?
🗪
01:03:43constantinopol Why do we need to check the remaining size > threshold ? Why not just use the remaining size if it satisfies the request size?
🗪
01:03:43constantinopol Why do we need to check the remaining size > threshold ? Why not just use the remaining size if it satisfies the request size?
🗪
01:03:43constantinopol Why do we need to check the remaining size > threshold ? Why not just use the remaining size if it satisfies the request size?
🗪
01:06:06snafusel How come this memory management system is strictly limited to game assets and not other things as well?
🗪
01:06:06snafusel How come this memory management system is strictly limited to game assets and not other things as well?
🗪
01:06:06snafusel How come this memory management system is strictly limited to game assets and not other things as well?
🗪
01:06:41gasto5 What will the GUI handle? (Answered at 01:11:18)
🗪
01:06:41gasto5 What will the GUI handle? (Answered at 01:11:18)
🗪
01:06:41gasto5 What will the GUI handle? (Answered at 01:11:18)
🗪
01:06:52grumpygiant256 If this were a commercial project, would it make sense to use malloc instead here, or write your own anyway for managing assets?
🗪
01:06:52grumpygiant256 If this were a commercial project, would it make sense to use malloc instead here, or write your own anyway for managing assets?
🗪
01:06:52grumpygiant256 If this were a commercial project, would it make sense to use malloc instead here, or write your own anyway for managing assets?
🗪
01:09:30gasto5 Any possibility of using Markov Chains for the game or game engine?
🗪
01:09:30gasto5 Any possibility of using Markov Chains for the game or game engine?
🗪
01:09:30gasto5 Any possibility of using Markov Chains for the game or game engine?
🗪
01:09:47mojobojo It's looking like Vulkan, if it gets released in a timely manner, is going to be a good choice for hardware rendering. I just read that you have control over all memory to avoid any unknown allocations "Explicit memory management in Vulkan allows applications to use custom allocation strategies. For example to allocate all memory up-front and avoid any allocations during rendering"
🗪
01:09:47mojobojo It's looking like Vulkan, if it gets released in a timely manner, is going to be a good choice for hardware rendering. I just read that you have control over all memory to avoid any unknown allocations "Explicit memory management in Vulkan allows applications to use custom allocation strategies. For example to allocate all memory up-front and avoid any allocations during rendering"
🗪
01:09:47mojobojo It's looking like Vulkan, if it gets released in a timely manner, is going to be a good choice for hardware rendering. I just read that you have control over all memory to avoid any unknown allocations "Explicit memory management in Vulkan allows applications to use custom allocation strategies. For example to allocate all memory up-front and avoid any allocations during rendering"
🗪
01:11:08blah238 Have you thought about having a "prefab" asset that people could use to make more complex assets, like a whole house with functional doors?
🗪
01:11:08blah238 Have you thought about having a "prefab" asset that people could use to make more complex assets, like a whole house with functional doors?
🗪
01:11:08blah238 Have you thought about having a "prefab" asset that people could use to make more complex assets, like a whole house with functional doors?
🗪
01:11:19gasto5 (Referring to Q at 01:06:41) The GUI mentioned in the TODO list
🗪
01:11:19gasto5 (Referring to Q at 01:06:41) The GUI mentioned in the TODO list
🗪
01:11:19gasto5 (Referring to Q at 01:06:41) The GUI mentioned in the TODO list
🗪
01:11:48constantinopol You keep saying "split the block in half" What do you mean? 'Size = Size/2'?
🗪
01:11:48constantinopol You keep saying "split the block in half" What do you mean? 'Size = Size/2'?
🗪
01:11:48constantinopol You keep saying "split the block in half" What do you mean? 'Size = Size/2'?
🗪
01:13:36mojobojo (Referring to Q at 01:09:47) This is where I read it from: http://blog.imgtec.com/powervr/trying-out-the-new-vulkan-graphics-api-on-powervr-gpus
🗪
01:13:36mojobojo (Referring to Q at 01:09:47) This is where I read it from: http://blog.imgtec.com/powervr/trying-out-the-new-vulkan-graphics-api-on-powervr-gpus
🗪
01:13:36mojobojo (Referring to Q at 01:09:47) This is where I read it from: http://blog.imgtec.com/powervr/trying-out-the-new-vulkan-graphics-api-on-powervr-gpus
🗪
01:15:07insofaras Will the debug GUI have a cool console like Quake/Unreal?
🗪
01:15:07insofaras Will the debug GUI have a cool console like Quake/Unreal?
🗪
01:15:07insofaras Will the debug GUI have a cool console like Quake/Unreal?
🗪