From 116e83c426f84c7b35e6f0144f7ec2bb5c4434ff Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 16 Jun 2010 17:35:25 +0000 Subject: 2010-06-16 Joel Sherrill * score/src/objectallocate.c: Add conditionally compiled debug code to printk a message when an object allocation error occurs. This should be helpful in identifying when a ported package required more resources. --- cpukit/score/src/objectallocate.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'cpukit/score/src/objectallocate.c') diff --git a/cpukit/score/src/objectallocate.c b/cpukit/score/src/objectallocate.c index 3a4e329ab6..ac98945a74 100644 --- a/cpukit/score/src/objectallocate.c +++ b/cpukit/score/src/objectallocate.c @@ -28,6 +28,12 @@ #include #include +/* #define RTEMS_DEBUG_OBJECT_ALLOCATION */ + +#if defined(RTEMS_DEBUG_OBJECT_ALLOCATION) +#include +#endif + /*PAGE * * _Objects_Allocate @@ -82,5 +88,15 @@ Objects_Control *_Objects_Allocate( } } +#if defined(RTEMS_DEBUG_OBJECT_ALLOCATION) + if ( !the_object ) { + printk( + "OBJECT ALLOCATION FAILURE! API/Class %d/%d\n", + information->the_api, + information->the_class + ); + } +#endif + return the_object; } -- cgit v1.2.3