Ignore:
Timestamp:
Jan 28, 2014, 10:49:57 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
16a41cc
Parents:
a850d04
git-author:
Sebastian Huber <sebastian.huber@…> (01/28/14 10:49:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/04/14 09:06:34)
Message:

score: Add _Heap_Size_with_overhead()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/heap.h

    ra850d04 ra49bc35  
    465465}
    466466
     467/**
     468 * @brief Returns the size with administration and alignment overhead for one
     469 * allocation.
     470 */
     471RTEMS_INLINE_ROUTINE uintptr_t _Heap_Size_with_overhead(
     472  uintptr_t page_size,
     473  uintptr_t size,
     474  uintptr_t alignment
     475)
     476{
     477  if ( page_size != 0 ) {
     478    page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT );
     479  } else {
     480    page_size = CPU_ALIGNMENT;
     481  }
     482
     483  if ( page_size < alignment ) {
     484    page_size = alignment;
     485  }
     486
     487  return HEAP_BLOCK_HEADER_SIZE + page_size - 1 + size;
     488}
     489
    467490/** @} */
    468491
Note: See TracChangeset for help on using the changeset viewer.