RTEMS
objectactivecount.c
1 /*
2  * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Obere Lagerstr. 30
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifdef HAVE_CONFIG_H
16 #include "config.h"
17 #endif
18 
19 #include <rtems/score/objectimpl.h>
20 #include <rtems/score/assert.h>
21 #include <rtems/score/chainimpl.h>
22 
24  const Objects_Information *information
25 )
26 {
27  Objects_Maximum inactive;
28  Objects_Maximum maximum;
29 
31 
32  inactive = (Objects_Maximum)
33  _Chain_Node_count_unprotected( &information->Inactive );
34  maximum = _Objects_Get_maximum_index( information );
35 
36  return maximum - inactive;
37 }
static __inline__ Objects_Maximum _Objects_Get_maximum_index(const Objects_Information *information)
Returns the maximum index of the specified object class.
Definition: objectimpl.h:642
Chain_Control Inactive
This is the chain of inactive object control blocks.
Definition: objectdata.h:256
uint16_t Objects_Maximum
Definition: object.h:86
size_t _Chain_Node_count_unprotected(const Chain_Control *chain)
Returns the node count of the chain.
Information for the Assert Handler.
Inlined Routines in the Object Handler.
Objects_Maximum _Objects_Active_count(const Objects_Information *information)
Returns the count of active objects.
static __inline__ bool _Objects_Allocator_is_owner(void)
Checks if the allocator is the owner of the object allocator mutex.
Definition: objectimpl.h:857
The information structure used to manage each API class of objects.
Definition: objectdata.h:176
Chain Handler API.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.
Definition: assert.h:100