mirror of
https://github.com/Yours3lf/rpi-vk-driver.git
synced 2025-03-21 12:29:15 +01:00
fixed pool allocator whoops
This commit is contained in:
parent
81ac862990
commit
9f3d3de52f
@ -24,8 +24,8 @@ ConsecutivePoolAllocator createConsecutivePoolAllocator(char* b, unsigned bs, un
|
||||
unsigned last = s/bs - 1;
|
||||
for(unsigned c = 0; c < last; ++c)
|
||||
{
|
||||
*ptr = (uint32_t)ptr + bs;
|
||||
ptr += bs/4;
|
||||
*ptr = (char*)ptr + bs;
|
||||
ptr = (char*)ptr + bs;
|
||||
}
|
||||
|
||||
*ptr = 0; //last element
|
||||
|
@ -21,10 +21,11 @@ PoolAllocator createPoolAllocator(char* b, unsigned bs, unsigned s)
|
||||
|
||||
//initialize linked list of free pointers
|
||||
uint32_t* ptr = pa.nextFreeBlock;
|
||||
for(unsigned c = 0; c < s/bs - 1; ++c)
|
||||
unsigned last = s/bs - 1;
|
||||
for(unsigned c = 0; c < last; ++c)
|
||||
{
|
||||
*ptr = (uint32_t)ptr + bs;
|
||||
ptr += bs;
|
||||
*ptr = (char*)ptr + bs;
|
||||
ptr = (char*)ptr + bs;
|
||||
}
|
||||
|
||||
*ptr = 0; //last element
|
||||
|
Loading…
x
Reference in New Issue
Block a user