fix gran_alloc() miss allocation in mm_granalloc.c.
This commit is contained in:
parent
b80fb6befc
commit
1600980a82
@ -105,8 +105,6 @@ FAR void *gran_alloc(GRAN_HANDLE handle, size_t size)
|
||||
|
||||
/* Now search the granule allocation table for that number of contiguous */
|
||||
|
||||
alloc = priv->heapstart;
|
||||
|
||||
for (granidx = 0; granidx < priv->ngranules; granidx += 32)
|
||||
{
|
||||
/* Get the GAT index associated with the granule table entry */
|
||||
@ -118,7 +116,6 @@ FAR void *gran_alloc(GRAN_HANDLE handle, size_t size)
|
||||
|
||||
if (curr == 0xffffffff)
|
||||
{
|
||||
alloc += (32 << priv->log2gran);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -147,6 +144,8 @@ FAR void *gran_alloc(GRAN_HANDLE handle, size_t size)
|
||||
* granules left to satisfy the allocation.
|
||||
*/
|
||||
|
||||
alloc = priv->heapstart + (granidx << priv->log2gran);
|
||||
|
||||
for (bitidx = 0;
|
||||
bitidx < 32 && (granidx + bitidx + ngranules) <= priv->ngranules;
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user