BytePointer: address Axel's post-merge comments
These changes had been on review on Gerrit for a few weeks, why do the comment come only after they were merged? Change-Id: I54064973e08b8b4dc0624f4c09c7cafb7f04e437 Reviewed-on: https://review.haiku-os.org/c/1185 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
fb7498fe2e
commit
810071751d
@ -200,7 +200,8 @@ MessagingArea::AllocateCommand(uint32 commandWhat, int32 dataSize,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// init the command
|
// init the command
|
||||||
BytePointer<messaging_command> command((char*)fHeader + commandOffset);
|
BytePointer<messaging_command> command(fHeader);
|
||||||
|
command += commandOffset;
|
||||||
command->next_command = 0;
|
command->next_command = 0;
|
||||||
command->command = commandWhat;
|
command->command = commandWhat;
|
||||||
command->size = size;
|
command->size = size;
|
||||||
@ -243,7 +244,8 @@ MessagingArea::_CheckCommand(int32 offset, int32 &size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get and check size
|
// get and check size
|
||||||
BytePointer<messaging_command> command((char*)fHeader + offset);
|
BytePointer<messaging_command> command(fHeader);
|
||||||
|
command += offset;
|
||||||
size = command->size;
|
size = command->size;
|
||||||
if (size < (int32)sizeof(messaging_command))
|
if (size < (int32)sizeof(messaging_command))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -17,9 +17,10 @@ RANGE_MARKER_FUNCTION_BEGIN(SlabSmallObjectCache)
|
|||||||
|
|
||||||
|
|
||||||
static inline slab *
|
static inline slab *
|
||||||
slab_in_pages(const void *pages, size_t slab_size)
|
slab_in_pages(void *pages, size_t slab_size)
|
||||||
{
|
{
|
||||||
BytePointer<slab> pointer(((uint8 *)pages) + slab_size - sizeof(slab));
|
BytePointer<slab> pointer(pages);
|
||||||
|
pointer += slab_size - sizeof(slab);
|
||||||
return &pointer;
|
return &pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user