MCPcopy Create free account
hub / github.com/GJDuck/e9patch / malloc_mem_alloc

Function malloc_mem_alloc

examples/stdlib.c:2139–2152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2137}
2138
2139static uint32_t malloc_mem_alloc(struct malloc_pool_s *pool, uint32_t size,
2140 uint32_t lb, uint32_t ub)
2141{
2142 if (ub - lb < size)
2143 {
2144 errno = ENOMEM;
2145 return MA_NIL;
2146 }
2147 uint32_t lo = lb;
2148 uint32_t hi = lo + size;
2149 if (!malloc_mem_grow(pool, hi))
2150 return MA_NIL;
2151 return lo;
2152}
2153
2154static bool malloc_mem_realloc(struct malloc_pool_s *pool, uint32_t base,
2155 uint32_t size)

Callers 1

malloc_implFunction · 0.85

Calls 1

malloc_mem_growFunction · 0.85

Tested by

no test coverage detected