MCPcopy Create free account
hub / github.com/RsyncProject/rsync / pool_boundary

Function pool_boundary

lib/pool_alloc.c:309–326  ·  view source on GitHub ↗

If the current extent doesn't have "len" free space in it, mark it as full * so that the next alloc will start a new extent. If len is (size_t)-1, this * bump will always occur. The function returns a boundary address that can * be used with pool_free_old(), or a NULL if no memory is allocated. */

Source from the content-addressed store, hash-verified

307 * bump will always occur. The function returns a boundary address that can
308 * be used with pool_free_old(), or a NULL if no memory is allocated. */
309void *
310pool_boundary(alloc_pool_t p, size_t len)
311{
312 struct alloc_pool *pool = (struct alloc_pool *)p;
313 struct pool_extent *cur;
314
315 if (!pool || !pool->extents)
316 return NULL;
317
318 cur = pool->extents;
319
320 if (cur->free < len) {
321 cur->bound += cur->free;
322 cur->free = 0;
323 }
324
325 return PTR_ADD(cur->start, cur->free);
326}
327
328#define FDPRINT(label, value) \
329 do { \

Callers 2

flist_done_allocatingFunction · 0.85
flist_newFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected