Definition at line 284 of file SDL_render.c.
285{
287 size_t aligner, aligned;
289
292 while (gap) {
293 const size_t gapoffset = gap->
offset;
294 aligner = (alignment && ((gap->
offset % alignment) != 0)) ? (alignment - (gap->
offset % alignment)) : 0;
295 aligned = gapoffset + aligner;
296
297
298 if ((aligner < gap->
len) && ((gap->
len - aligner) >= numbytes)) {
299
300 if (gap->
len == numbytes) {
305 } else if (aligned == gapoffset) {
307 gap->
len -= numbytes;
308 }
else if (((aligned - gapoffset) + numbytes) == gap->
len) {
309 gap->
len -= numbytes;
310 } else {
312 if (!newgap) {
314 }
315 newgap->
offset = aligned + numbytes;
316 newgap->
len = gap->
len - (aligner + numbytes);
318
321 }
322
325 }
327 }
328
329
330 prevgap = gap;
332 }
333
334
337 const size_t newsize = current_allocation * 2;
342 }
345 }
346
349
353 }
354
355 if (aligner) {
357 if (newgap) {
359 newgap->
len = aligner;
361 prevgap->
next = newgap;
362 }
363 }
364
366
368}
#define SDL_assert(condition)
#define SDL_OutOfMemory()
static SDL_AllocVertGap * AllocateVertexGap(SDL_Renderer *renderer)
struct SDL_AllocVertGap * next
SDL_AllocVertGap vertex_data_gaps
size_t vertex_data_allocation
SDL_AllocVertGap * vertex_data_gaps_pool
static SDL_Renderer * renderer
References AllocateVertexGap(), SDL_AllocVertGap::len, SDL_AllocVertGap::next, NULL, SDL_AllocVertGap::offset, renderer, retval, SDL_assert, SDL_OutOfMemory, SDL_realloc, SDL_Renderer::vertex_data, SDL_Renderer::vertex_data_allocation, SDL_Renderer::vertex_data_gaps, SDL_Renderer::vertex_data_gaps_pool, and SDL_Renderer::vertex_data_used.
Referenced by SW_QueueCopy(), SW_QueueCopyEx(), SW_QueueDrawPoints(), and SW_QueueFillRects().