Changeset e050d9a in rtems


Ignore:
Timestamp:
Jun 8, 2009, 10:50:27 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
5f6a4a2
Parents:
93f4ac26
Message:

2009-06-08 Joel Sherrill <joel.sherrill@…>

  • score/src/heapwalk.c: Verify addresses are aligned.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r93f4ac26 re050d9a  
     12009-06-08      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/src/heapwalk.c: Verify addresses are aligned.
     4
    152009-06-03      Ralf Corsépius <ralf.corsepius@rtems.org>
    26
  • cpukit/score/src/heapwalk.c

    r93f4ac26 re050d9a  
    1919
    2020#include <rtems/system.h>
     21#include <rtems/score/address.h>
    2122#include <rtems/score/sysstate.h>
    2223#include <rtems/score/heap.h>
     
    101102    }
    102103
    103     if (!_Heap_Is_block_in(the_heap, next_block)) {
    104       if (do_dump) printk("\n");
    105       printk("PASS: %d !block %p is out of heap\n", source, next_block);
     104
     105    if (!_Addresses_Is_aligned(next_block) ) {
     106      printk("PASS: %d next_block %p is not aligned\n", source, next_block);
    106107      error = 1;
    107108      break;
    108109    }
    109 
     110   
    110111    if (!_Heap_Is_prev_used(next_block)) {
    111112      if (do_dump)
     
    124125      { /* Check if 'the_block' is in the free block list */
    125126        Heap_Block* block = _Heap_First(the_heap);
    126         while(block != the_block && block != tail)
     127        if (!_Addresses_Is_aligned(block) ) {
     128          printk(
     129            "PASS: %d first free block %p is not aligned\n", source, block);
     130          error = 1;
     131          break;
     132        }
     133        while(block != the_block && block != tail) {
     134          if (!_Addresses_Is_aligned(block) ) {
     135            printk(
     136              "PASS: %d a free block %p is not aligned\n", source, block);
     137            error = 1;
     138            break;
     139          }
     140          if (!_Heap_Is_block_in(the_heap, block)) {
     141            printk("PASS: %d a free block %p is not in heap\n", source, block);
     142            error = 1;
     143            break;
     144          }
    127145          block = block->next;
    128         if(block != the_block) {
     146        }
     147        if (block != the_block) {
    129148          if (do_dump || error) printk("\n");
    130149          printk("PASS: %d !the_block not in the free list", source);
Note: See TracChangeset for help on using the changeset viewer.