cinera_handmade.network/cmuratori/hero/code/code158.hmml

41 lines
3.2 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Tracking Asset Usage" vod_platform=youtube id=D5JG3XGPf8Y annotator=debiatan annotator=ZedZull]
[00:00:18][Recap and plan for today]
[00:01:12][Using the OS's virtual memory system to solve our memory management problem]
[00:04:27][Tracking memory load]
[00:04:51][Using an allocation scheme that gets the memory from the OS and returns it on eviction]
[00:08:19][Implementing platform_allocate_memory]
[00:10:26][These changes break the looped live code editing feature]
[00:12:57][Two approaches: a) deferring LoadBitmap calls till the end of the frame and b) keeping some amount of free space to make loading always possible]
[00:13:40][Tracking amount of memory used in the asset system (AcquireAssetMemory)]
[00:15:16][RealeaseAssetMemory requires us to provide the size of asset to free]
[00:18:16][Using the platform calls instead of the memory arenas]
[00:19:17][Tracking memory usage and freeing memory at the end of the frame (EvictAssetsAsNecessary)]
[00:21:40][Evicting the least recently used asset]
[00:23:18][EvictAsset]
[00:26:44][Distinguishing between bitmaps and sound inside AssetState]
[00:29:35][Computing the amount of memory taken by an asset]
[00:35:11][Getting rid of duplicated calculations]
[00:41:41][Figuring out the location of the chunk of memory to free]
[00:45:52][Doubly linked list to keep track of least recently used asset]
[00:52:09][Doubly linked list theory (blackboard)]
[00:53:55][AddAssetHeaderToList]
[00:56:21][Semantic setup of pointers]
[00:57:13][RemoveAssetHeaderFromList]
[01:02:18][Initial sentinel setup]
[01:04:33][We should avoid evicting locked assets]
[01:07:32][Types of doubly linked lists and overview of their implementation]
[01:10:00][Q&A][:speech]
[01:10:05][@noxy_key][What function owns the pointer to the head of linked list?]
[01:10:16][@zuurr_][Isn't a linked list what you're always told not to do if you're care about the cache at all?]
[01:11:45][@insofaras][Could the platform_allocate_memory function allocate a few bytes more than requested and store the size there to avoid it having to be passed to the free function?]
[01:12:07][@constantinopol][Having a list header at the end of each asset struct, wouldn't that invalidate the cache a lot, when processing the list, since asset structs are potentially large?]
[01:13:14][@phazyck][In RemoveAssetHeaderFromList, would it make sense to zero out the prev and next pointers of the header that is being removed, or is it just unnecessary cleanup? Are there pros and cons to this?]
[01:13:56][@captainduh][Will there be a fountain of heads somewhere in the actual game, possibly as a Halloween item?]
[01:14:03][@sukmiekok][Is Twitch your full-time job?]
[01:14:07][@guit4rfreak][How will you re-enable the live code reloading after this is done?]
[01:15:13][@cubercaleb][Can you briefly go over inlined functions?]
[01:16:20][@abnercoimbre][Which classic data structure do you enjoy implementing the most?]
[01:17:08][@grumpygiant256][Does/will this system support hotloading of assets?]
[01:18:38][@guit4rfreak][Does it make sense to write your own non-block dynamic allocator instead of using the memory system of the OS?]
[/video]