libmedia: use size_t consistently in rtm_pool.
* fixed a bad address error on x86_64.
This commit is contained in:
parent
ab3fd9c828
commit
1fe06744d4
@ -49,10 +49,10 @@ public:
|
|||||||
|
|
||||||
void* AllocatedAddress() const;
|
void* AllocatedAddress() const;
|
||||||
static FreeChunk* SetToAllocated(void* allocated);
|
static FreeChunk* SetToAllocated(void* allocated);
|
||||||
static addr_t NextOffset() { return sizeof(uint32); }
|
static addr_t NextOffset() { return sizeof(size_t); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32 fSize;
|
size_t fSize;
|
||||||
FreeChunk* fNext;
|
FreeChunk* fNext;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ FreeChunk::AllocatedAddress() const
|
|||||||
FreeChunk*
|
FreeChunk*
|
||||||
FreeChunk::SetToAllocated(void* allocated)
|
FreeChunk::SetToAllocated(void* allocated)
|
||||||
{
|
{
|
||||||
return (FreeChunk*)((uint8*)allocated - FreeChunk::NextOffset());
|
return (FreeChunk*)((addr_t)allocated - FreeChunk::NextOffset());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ rtm_alloc(rtm_pool* pool, size_t size)
|
|||||||
last->SetNext(chunk->Next());
|
last->SetNext(chunk->Next());
|
||||||
}
|
}
|
||||||
|
|
||||||
pool->available -= size + sizeof(uint32);
|
pool->available -= size + sizeof(size_t);
|
||||||
|
|
||||||
TRACE("malloc(%lu) -> %p\n", size, chunk->AllocatedAddress());
|
TRACE("malloc(%lu) -> %p\n", size, chunk->AllocatedAddress());
|
||||||
return chunk->AllocatedAddress();
|
return chunk->AllocatedAddress();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user