Changeset 0e75aae5 in rtems


Ignore:
Timestamp:
Aug 24, 2012, 1:56:49 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
45f9cd0
Parents:
b6b8cd7
git-author:
Sebastian Huber <sebastian.huber@…> (08/24/12 13:56:49)
git-committer:
Gedare Bloom <gedare@…> (01/11/18 17:37:45)
Message:

score: Use _Workspace_Allocate_or_fatal_error()

Use _Workspace_Allocate_or_fatal_error() consistently in case auto
extend is turned off. This helps to avoid undefined behaviour in
_API_Mutex_Allocate() in case _API_Mutex_Information() fails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/objectextendinformation.c

    rb6b8cd7 r0e75aae5  
    143143           (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
    144144          ((maximum + minimum_index) * sizeof(Objects_Control *));
    145     object_blocks = (void**) _Workspace_Allocate( block_size );
    146 
    147     if ( !object_blocks ) {
    148       _Workspace_Free( new_object_block );
    149       return;
     145    if ( information->auto_extend ) {
     146      object_blocks = _Workspace_Allocate( block_size );
     147      if ( !object_blocks ) {
     148        _Workspace_Free( new_object_block );
     149        return;
     150      }
     151    } else {
     152      object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
    150153    }
    151154
Note: See TracChangeset for help on using the changeset viewer.