LCOV - code coverage report
Current view: top level - os_stub/malloclib - malloclib.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 90.9 % 11 10
Test Date: 2025-07-27 08:10:33 Functions: 100.0 % 3 3

            Line data    Source code
       1              : /**
       2              :  *  Copyright Notice:
       3              :  *  Copyright 2021-2022 DMTF. All rights reserved.
       4              :  *  License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/libspdm/blob/main/LICENSE.md
       5              :  **/
       6              : 
       7              : #include <base.h>
       8              : 
       9              : #include <stdio.h>
      10              : #include <stdlib.h>
      11              : #include <string.h>
      12              : #include <assert.h>
      13              : 
      14          187 : void *allocate_pool(size_t AllocationSize)
      15              : {
      16          187 :     return malloc(AllocationSize);
      17              : }
      18              : 
      19      2686297 : void *allocate_zero_pool(size_t AllocationSize)
      20              : {
      21              :     void *buffer;
      22      2686297 :     buffer = malloc(AllocationSize);
      23      2686297 :     if (buffer == NULL) {
      24            0 :         return NULL;
      25              :     }
      26      2686297 :     memset(buffer, 0, AllocationSize);
      27      2686297 :     return buffer;
      28              : }
      29              : 
      30      2685354 : void free_pool(void *buffer)
      31              : {
      32      2685354 :     free(buffer);
      33      2685354 : }
        

Generated by: LCOV version 2.0-1