GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_system_views_free.c Lines: 7 7 100.0 %
Date: 2026-03-06 19:21:09 Branches: 2 2 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   System Management (System)                                          */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_system.h"
29
#include "gx_utility.h"
30
31
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _gx_system_views_free                               PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function returns a list of views to the free list              */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    head                                  Pointer to head of list to    */
49
/*                                            free                        */
50
/*                                                                        */
51
/*  OUTPUT                                                                */
52
/*                                                                        */
53
/*    None                                                                */
54
/*                                                                        */
55
/*  CALLS                                                                 */
56
/*                                                                        */
57
/*    None                                                                */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    _gx_all_views_free                    Release all views             */
62
/*                                                                        */
63
/**************************************************************************/
64
65
1937
VOID _gx_system_views_free(GX_VIEW *head)
66
{
67
1937
GX_VIEW *tail = head;
68
69
    /* find the tail end of this window's viewport list */
70
4315
    while (tail -> gx_view_next)
71
    {
72
2378
        tail = tail -> gx_view_next;
73
    }
74
    /* link last viewport to head of free list */
75
1937
    tail -> gx_view_next = _gx_system_free_views;
76
77
    /* free list start becomes the list */
78
1937
    _gx_system_free_views = head;
79
1937
}
80