source: rtems/cpukit/score/src/heapalignupuptr.c @ 371cea31

4.104.11
Last change on this file since 371cea31 was 371cea31, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 26, 2009 at 12:00:24 PM

2009-08-24 Sebastian Huber <Sebastian.Huber@…>

  • libmisc/stackchk/check.c, rtems/src/regionreturnsegment.c, rtems/src/regiongetsegmentsize.c, src/heapalignupuptr.c, src/heapallocatealigned.c, src/heapallocate.c, src/heap.c, src/heapextend.c, src/heapfree.c, src/heapgetfreeinfo.c, src/heapgetinfo.c, src/heapresizeblock.c, src/heapsizeofuserarea.c, src/heapwalk.c, src/pheapgetblocksize.c, inline/rtems/score/heap.inl, include/rtems/score/heap.h: Overall cleanup. Changed all types for addresses, sizes, offsets and alignments to uintptr_t. Reformatted. Added variables for clarity. Renamed various objects. Enabled _HAssert() for all instances. More changes follow.
  • Property mode set to 100644
File size: 781 bytes
Line 
1#if 0
2/*
3 *  Heap Handler
4 *
5 *  COPYRIGHT (c) 1989-2009.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/system.h>
20#include <rtems/score/heap.h>
21
22/*
23 * This routine is NOT inlined because it has a branch which leads to
24 * path explosion where it is used.  This makes full test coverage more
25 * difficult.
26 */
27uintptr_t _Heap_Align_up(
28  uintptr_t value,
29  uintptr_t alignment
30)
31{
32  uintptr_t remainder = value % alignment;
33
34  if ( remainder != 0 ) {
35    return value - remainder + alignment;
36  } else {
37    return value;
38  }
39}
40#endif
Note: See TracBrowser for help on using the repository browser.