MCPcopy Create free account
hub / github.com/defold/defold / GetNextRequest

Function GetNextRequest

engine/resource/src/async/load_queue_threaded.cpp:61–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 };
60
61 static Request* GetNextRequest(Queue* queue)
62 {
63 // Since we can be loading many things at once, track the total Capacity() for buffers
64 // that are waiting to be picked up by the preloader. In the case of the queue being filled
65 // with only large requests (say only 4Mb textures), this throttles a bit so memory consumption
66 // does not run away.
67 if (queue->m_BytesWaiting >= MAX_PENDING_DATA)
68 {
69 return 0x0;
70 }
71
72 if (queue->m_Loaded == queue->m_Front)
73 {
74 return 0x0;
75 }
76
77 return &queue->m_Request[queue->m_Loaded % QUEUE_SLOTS];
78 }
79
80 static void LoadThread(void* arg)
81 {

Callers 1

LoadThreadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected