source: rtems/cpukit/score/src/objectfree.c @ 4fc370e

4.115
Last change on this file since 4fc370e was e0f91da, checked in by Alex Ivanov <alexivanov97@…>, on 11/30/12 at 21:34:17

score misc: Score misc: Clean up Doxygen #9 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

https://google-melange.appspot.com/gci/task/view/google/gci2012/7977211

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Free Object
5 *  @ingroup ScoreObject
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-1999.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/system.h>
22#include <rtems/score/address.h>
23#include <rtems/score/chain.h>
24#include <rtems/score/object.h>
25#if defined(RTEMS_MULTIPROCESSING)
26#include <rtems/score/objectmp.h>
27#endif
28#include <rtems/score/thread.h>
29#include <rtems/score/wkspace.h>
30#include <rtems/score/sysstate.h>
31#include <rtems/score/isr.h>
32
33void _Objects_Free(
34  Objects_Information *information,
35  Objects_Control     *the_object
36)
37{
38  uint32_t    allocation_size = information->allocation_size;
39
40  _Chain_Append( &information->Inactive, &the_object->Node );
41
42  if ( information->auto_extend ) {
43    uint32_t    block;
44
45    block = (uint32_t) (_Objects_Get_index( the_object->id ) -
46                        _Objects_Get_index( information->minimum_id ));
47    block /= information->allocation_size;
48
49    information->inactive_per_block[ block ]++;
50    information->inactive++;
51
52    /*
53     *  Check if the threshold level has been met of
54     *  1.5 x allocation_size are free.
55     */
56
57    if ( information->inactive > ( allocation_size + ( allocation_size >> 1 ) ) ) {
58      _Objects_Shrink_information( information );
59    }
60  }
61}
Note: See TracBrowser for help on using the repository browser.