Index: cpukit/ChangeLog
===================================================================
--- cpukit/ChangeLog	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/ChangeLog	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -1,2 +1,12 @@
+2010-06-30	Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+	PR 1472/cpukit
+	* libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h,
+	libcsupport/src/free.c, libcsupport/src/malloc.c,
+	libcsupport/src/malloc_initialize.c, libcsupport/src/realloc.c,
+	libcsupport/src/rtems_memalign.c: Remove malloc boundary code. It has
+	not been used since before 4.6 and is bitrotted.
+	* libcsupport/src/malloc_boundary.c: Removed.
+
 2010-06-30	Jennifer.Averett <Jennifer.Averett@OARcorp.com>
 
Index: cpukit/libcsupport/Makefile.am
===================================================================
--- cpukit/libcsupport/Makefile.am	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/Makefile.am	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -90,8 +90,7 @@
     src/mallocinfo.c src/malloc_walk.c src/malloc_get_statistics.c \
     src/malloc_report_statistics.c src/malloc_report_statistics_plugin.c \
-    src/malloc_statistics_helpers.c src/malloc_boundary.c \
-    src/posix_memalign.c src/rtems_memalign.c src/malloc_deferred.c \
-    src/malloc_sbrk_helpers.c src/malloc_dirtier.c src/malloc_p.h \
-    src/rtems_malloc.c
+    src/malloc_statistics_helpers.c src/posix_memalign.c \
+    src/rtems_memalign.c src/malloc_deferred.c src/malloc_sbrk_helpers.c \
+    src/malloc_dirtier.c src/malloc_p.h src/rtems_malloc.c
 
 PASSWORD_GROUP_C_FILES = src/getpwent.c
Index: cpukit/libcsupport/include/rtems/malloc.h
===================================================================
--- cpukit/libcsupport/include/rtems/malloc.h	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/include/rtems/malloc.h	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -55,18 +55,4 @@
   rtems_malloc_statistics_helpers_table;
 extern rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers;
-
-/*
- *  Malloc boundary support plugin
- */
-typedef struct {
-  void     (*initialize)(void);
-  uint32_t (*overhead)(void);
-  void     (*at_malloc)(void *, size_t);
-  void     (*at_free)(void *);
-  void     (*at_realloc)(void *, size_t);
-} rtems_malloc_boundary_functions_t;
-
-extern rtems_malloc_boundary_functions_t rtems_malloc_boundary_helpers_table;
-extern rtems_malloc_boundary_functions_t *rtems_malloc_boundary_helpers;
 
 /*
Index: cpukit/libcsupport/src/free.c
===================================================================
--- cpukit/libcsupport/src/free.c	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/src/free.c	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -36,5 +36,4 @@
    *  Do not attempt to free memory if in a critical section or ISR.
    */
-
   if ( _System_state_Is_up(_System_state_Get()) &&
        !malloc_is_system_state_OK() ) {
@@ -42,12 +41,4 @@
       return;
   }
-
-  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-    /*
-     *  If configured, check the boundary area
-     */
-    if ( rtems_malloc_boundary_helpers )
-      (*rtems_malloc_boundary_helpers->at_free)(ptr);
-  #endif
 
   /*
Index: cpukit/libcsupport/src/malloc.c
===================================================================
--- cpukit/libcsupport/src/malloc.c	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/src/malloc.c	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -56,13 +56,4 @@
   #endif
 
-  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-    /*
-     *  If the support for a boundary area at the end of the heap
-     *  block allocated is turned on, then adjust the size.
-     */
-    if (rtems_malloc_boundary_helpers)
-      size += (*rtems_malloc_boundary_helpers->overhead)();
-  #endif
-
   /*
    * Try to give a segment in the current heap if there is not
@@ -94,12 +85,4 @@
     (*rtems_malloc_statistics_helpers->at_malloc)(return_this);
 
-  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-    /*
-     * If configured, set the boundary area
-     */
-    if (rtems_malloc_boundary_helpers)
-      (*rtems_malloc_boundary_helpers->at_malloc)(return_this, size);
-  #endif
-
   return return_this;
 }
Index: ukit/libcsupport/src/malloc_boundary.c
===================================================================
--- cpukit/libcsupport/src/malloc_boundary.c	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ 	(revision )
@@ -1,200 +1,0 @@
-/*
- *  RTEMS Malloc Block Boundary Integrity Checker
- *
- *  WARNING!!!  WARNING!!!  WARNING!!!  WARNING!!!
- *  WARNING!!!  WARNING!!!  WARNING!!!  WARNING!!!
- *
- *  This file is built but never called.  It is a first
- *  step in reintegrating this functionality.
- *  This code was disabled for a LONG time in malloc.c.
- *  This is a restructured and slightly modified version
- *  that should be able to be configured as a plugin BUT
- *  it has not been tested recently.  When it has been
- *  tested again, please remove this comment.
- *
- *  JOEL: I have not analyzed this code in terms of
- *        the heap changes post 4.6.  It is possible
- *        that that way the boundary area is carved
- *        off breaks the alignment.
- *
- *  WARNING!!!  WARNING!!!  WARNING!!!  WARNING!!!
- *  WARNING!!!  WARNING!!!  WARNING!!!  WARNING!!!
- *
- *  COPYRIGHT (c) 1989-2007.
- *  On-Line Applications Research Corporation (OAR).
- *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.com/license/LICENSE.
- *
- *  $Id$
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "malloc_p.h"
-
-#include <stdio.h>
-
-/* only supported on newlib targets */
-#ifdef RTEMS_NEWLIB
-/* not completely implemented so not included in coverage analysis */
-#ifndef RTEMS_COVERAGE
-
-#define SENTINELSIZE    12
-#define SENTINEL       "\xD1\xAC\xB2\xF1" "BITE ME"
-#define CALLCHAINSIZE 5
-
-struct mallocNode {
-  struct mallocNode *back;
-  struct mallocNode *forw;
-  int                callChain[CALLCHAINSIZE];
-  size_t             size;
-  void              *memory;
-};
-
-struct mallocNode mallocNodeHead;
-
-static void rtems_malloc_boundary_initialize(void)
-{
-  mallocNodeHead.back = &mallocNodeHead;
-  mallocNodeHead.forw = &mallocNodeHead;
-}
-
-static uint32_t rtems_malloc_boundary_overhead(void)
-{
-  return sizeof(struct mallocNode) + SENTINELSIZE;
-}
-
-static void rtems_malloc_boundary_at_malloc(
-  void     *pointer,
-  size_t    size
-)
-{
-  void *return_this;
-  struct mallocNode *mp = (struct mallocNode *)pointer;
-  intptr_t *fp, *nfp;
-  int i;
-
-  _RTEMS_Lock_allocator();
-    mp->memory = mp + 1;
-    return_this = mp->memory;
-    mp->size = size - (sizeof(struct mallocNode) + SENTINELSIZE);
-    fp = (intptr_t *)&size - 2;
-    for (i = 0 ; i < CALLCHAINSIZE ; i++) {
-      mp->callChain[i] = fp[1];
-      nfp = (intptr_t *)(fp[0]);
-      if((nfp <= fp) || (nfp > (intptr_t *)(INT32_C(0x1000000) /* 1 << 24 */)))
-       break;
-      fp = nfp;
-    }
-    while (i < CALLCHAINSIZE)
-      mp->callChain[i++] = 0;
-    memcpy((char *)mp->memory + mp->size, SENTINEL, SENTINELSIZE);
-    mp->forw = mallocNodeHead.forw;
-    mp->back = &mallocNodeHead;
-    mallocNodeHead.forw->back = mp;
-    mallocNodeHead.forw = mp;
-  _RTEMS_Unlock_allocator();
-}
-
-static void reportMallocError(const char *msg, struct mallocNode *mp);
-
-static void rtems_malloc_boundary_at_free(
-  void     *pointer
-)
-{
-  struct mallocNode *mp = (struct mallocNode *)pointer - 1;
-  struct mallocNode *mp1;
-
-  _RTEMS_Lock_allocator();
-    if ((mp->memory != (mp + 1)) ||
-        (memcmp((char *)mp->memory + mp->size, SENTINEL, SENTINELSIZE) != 0))
-      reportMallocError("Freeing with inconsistent pointer/sentinel", mp);
-    mp1 = mallocNodeHead.forw;
-    while (mp1 != &mallocNodeHead) {
-      if (mp1 == mp)
-        break;
-      mp1 = mp1->forw;
-    }
-    if (mp1 != mp)
-      reportMallocError("Freeing, but not on allocated list", mp);
-    mp->forw->back = mp->back;
-    mp->back->forw = mp->forw;
-    mp->back = mp->forw = NULL;
-    pointer = mp;
-  _RTEMS_Unlock_allocator();
-}
-
-static void rtems_malloc_boundary_at_realloc(
-  void     *pointer __attribute__((unused)),
-  size_t    size __attribute__((unused))
-)
-{
-  /* this needs to be implemented */
-}
-
-/*
- *  Malloc boundary support plugin
- */
-rtems_malloc_boundary_functions_t rtems_malloc_boundary_functions_table = {
-  rtems_malloc_boundary_initialize,
-  rtems_malloc_boundary_overhead,
-  rtems_malloc_boundary_at_malloc,
-  rtems_malloc_boundary_at_free,
-  rtems_malloc_boundary_at_realloc,
-};
-
-rtems_malloc_boundary_functions_t *rtems_malloc_boundary_helpers = NULL;
-/*   &rtems_malloc_boundary_functions_table; */
-
-static void reportMallocError(const char *msg, struct mallocNode *mp)
-{
-    unsigned char *sp = (unsigned char *)mp->memory + mp->size;
-    int i, ind = 0;
-    static char cbuf[500];
-    ind += sprintf(cbuf+ind, "Malloc Error: %s\n", msg);
-    if ((mp->forw->back != mp) || (mp->back->forw != mp))
-        ind += sprintf(cbuf+ind,
-            "mp:%p  mp->forw:%p  mp->forw->back:%p  "
-            "mp->back:%p  mp->back->forw:%p\n",
-            mp, mp->forw, mp->forw->back, mp->back, mp->back->forw);
-    if (mp->memory != (mp + 1))
-        ind += sprintf(cbuf+ind, "mp+1:%p  ", mp + 1);
-    ind += sprintf(cbuf+ind, "mp->memory:%p  mp->size:%zi\n", mp->memory, mp->size);
-    if (memcmp((char *)mp->memory + mp->size, SENTINEL, SENTINELSIZE) != 0) {
-        ind += sprintf(cbuf+ind, "mp->sentinel: ");
-        for (i = 0 ; i < SENTINELSIZE ; i++)
-            ind += sprintf(cbuf+ind, " 0x%x", sp[i]);
-        ind += sprintf(cbuf+ind, "\n");
-    }
-    ind += sprintf(cbuf+ind, "Call chain:");
-    for (i = 0 ; i < CALLCHAINSIZE ; i++) {
-        if (mp->callChain[i] == 0)
-            break;
-        ind += sprintf(cbuf+ind, " 0x%x", mp->callChain[i]);
-    }
-    printk("\n\n%s\n\n", cbuf);
-}
-
-#if UNUSED
-static void checkMallocArena(void)
-{
-  struct mallocNode *mp;
-
-  _RTEMS_Lock_allocator();
-    for ( mp = mallocNodeHead.forw; mp != &mallocNodeHead ; mp = mp->forw ) {
-      if ((mp->forw->back != mp) || (mp->back->forw != mp))
-        reportMallocError("Pointers mangled", mp);
-      if ((mp->memory != (mp + 1)) ||
-          (memcmp((char *)mp->memory + mp->size, SENTINEL, SENTINELSIZE) != 0))
-        reportMallocError("Inconsistent pointer/sentinel", mp);
-    }
-  _RTEMS_Unlock_allocator();
-}
-#endif
-
-#endif
-#endif
Index: cpukit/libcsupport/src/malloc_initialize.c
===================================================================
--- cpukit/libcsupport/src/malloc_initialize.c	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/src/malloc_initialize.c	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -44,13 +44,4 @@
 )
 {
-  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-    /*
-     *  If configured, initialize the boundary support
-     */
-    if ( rtems_malloc_boundary_helpers != NULL ) {
-      (*rtems_malloc_boundary_helpers->initialize)();
-    }
-  #endif
-
   /*
    *  If configured, initialize the statistics support
Index: cpukit/libcsupport/src/realloc.c
===================================================================
--- cpukit/libcsupport/src/realloc.c	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/src/realloc.c	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -28,5 +28,4 @@
   uintptr_t old_size;
   char    *new_area;
-  uintptr_t resize;
 
   MSBUMP(realloc_calls, 1);
@@ -61,21 +60,7 @@
 
   /*
-   *  If block boundary integrity checking is enabled, then
-   *  we need to account for the boundary memory again.
+   *  Now resize it.
    */
-  resize = size;
-  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-    if (rtems_malloc_boundary_helpers)
-      resize += (*rtems_malloc_boundary_helpers->overhead)();
-  #endif
-
-  if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, resize ) ) {
-    #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-      /*
-       *  Successful resize.  Update the boundary on the same block.
-       */
-      if (rtems_malloc_boundary_helpers)
-        (*rtems_malloc_boundary_helpers->at_realloc)(ptr, resize);
-    #endif
+  if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
     return ptr;
   }
Index: cpukit/libcsupport/src/rtems_memalign.c
===================================================================
--- cpukit/libcsupport/src/rtems_memalign.c	(revision efc253fa86296896a64c84b945206497249ffc54)
+++ cpukit/libcsupport/src/rtems_memalign.c	(revision 7c658feb2e840582f2564d72c477e7ea0c7d3f76)
@@ -46,22 +46,11 @@
 
   /*
-   *
    *  If some free's have been deferred, then do them now.
    */
   malloc_deferred_frees_process();
 
-  #if defined(RTEMS_MALLOC_BOUNDARY_HELPERS)
-    /*
-     *  If the support for a boundary area at the end of the heap
-     *  block allocated is turned on, then adjust the size.
-     */
-    if (rtems_malloc_boundary_helpers)
-      size += (*rtems_malloc_boundary_helpers->overhead)();
-  #endif
-
   /*
    *  Perform the aligned allocation requested
    */
-
   return_this = _Protected_heap_Allocate_aligned(
     RTEMS_Malloc_Heap,
