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-06-29 08:09:00 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      2686261 : void *allocate_zero_pool(size_t AllocationSize)
      20              : {
      21              :     void *buffer;
      22      2686261 :     buffer = malloc(AllocationSize);
      23      2686261 :     if (buffer == NULL) {
      24            0 :         return NULL;
      25              :     }
      26      2686261 :     memset(buffer, 0, AllocationSize);
      27      2686261 :     return buffer;
      28              : }
      29              : 
      30      2685317 : void free_pool(void *buffer)
      31              : {
      32      2685317 :     free(buffer);
      33      2685317 : }
        

Generated by: LCOV version 2.0-1