Changeset 6cf45cb in rtems


Ignore:
Timestamp:
Apr 7, 2014, 2:50:13 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
7a597e97
Parents:
2d5424d2
git-author:
Sebastian Huber <sebastian.huber@…> (04/07/14 14:50:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/09/14 13:30:25)
Message:

score: Fix workspace size estimate for TLS

Location:
cpukit/score
Files:
3 edited

Legend:

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

    r2d5424d2 r6cf45cb  
    450450}
    451451
     452RTEMS_INLINE_ROUTINE uintptr_t _Heap_Min_block_size( uintptr_t page_size )
     453{
     454  return _Heap_Align_up( sizeof( Heap_Block ), page_size );
     455}
     456
    452457/**
    453458 * @brief Returns the worst case overhead to manage a memory area.
  • cpukit/score/src/heap.c

    r2d5424d2 r6cf45cb  
    229229    }
    230230  }
    231   min_block_size = _Heap_Align_up( sizeof( Heap_Block ), page_size );
     231
     232  min_block_size = _Heap_Min_block_size( page_size );
    232233
    233234  area_ok = _Heap_Get_first_and_last_block(
  • cpukit/score/src/wkspace.c

    r2d5424d2 r6cf45cb  
    6868
    6969  if ( tls_size > 0 ) {
    70     uintptr_t tls_alignment = (uintptr_t) _TLS_Alignment;
    71     uintptr_t tls_alloc = _TLS_Get_allocation_size( tls_size, tls_alignment );
     70    uintptr_t tls_align = _TLS_Heap_align_up( (uintptr_t) _TLS_Alignment );
     71    uintptr_t tls_alloc = _TLS_Get_allocation_size( tls_size, tls_align );
     72
     73    /*
     74     * Memory allocated with an alignment constraint is allocated from the end
     75     * of a free block.  The last allocation may need one free block of minimum
     76     * size.
     77     */
     78    remaining += _Heap_Min_block_size( page_size );
    7279
    7380    remaining += _Get_maximum_thread_count()
    74       * _Heap_Size_with_overhead( page_size, tls_alloc, tls_alignment );
     81      * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align );
    7582  }
    7683
Note: See TracChangeset for help on using the changeset viewer.