LCOV - code coverage report
Current view: top level - src/test - LG_brutal_setup.c (source / functions) Hit Total Coverage
Test: LAGraph code coverage report. Commit id: 3b461aa. Current time (UTC): 2024-01-25T16:04:32Z Lines: 8 8 100.0 %
Date: 2024-01-25 16:05:28 Functions: 1 1 100.0 %

          Line data    Source code
       1             : //------------------------------------------------------------------------------
       2             : // LG_brutal_setup.c: setup an LAGraph test with brutal memory testing
       3             : // -----------------------------------------------------------------------------
       4             : 
       5             : // LAGraph, (c) 2019-2022 by The LAGraph Contributors, All Rights Reserved.
       6             : // SPDX-License-Identifier: BSD-2-Clause
       7             : //
       8             : // For additional details (including references to third party source code and
       9             : // other files) see the LICENSE file or contact permission@sei.cmu.edu. See
      10             : // Contributors.txt for a full list of contributors. Created, in part, with
      11             : // funding and support from the U.S. Government (see Acknowledgments.txt file).
      12             : // DM22-0790
      13             : 
      14             : // Contributed by Timothy A. Davis, Texas A&M University
      15             : 
      16             : //------------------------------------------------------------------------------
      17             : 
      18             : #include "LG_internal.h"
      19             : #include "LG_test.h"
      20             : 
      21          27 : int LG_brutal_setup (char *msg)
      22             : {
      23          27 :     LG_brutal = -1 ;        // disable brutal testing for now
      24          27 :     LG_nmalloc = 0 ;        // assuming nothing is malloc'd
      25          27 :     int result = LAGr_Init (GrB_NONBLOCKING,
      26             :         LG_brutal_malloc, LG_brutal_calloc,
      27             :         LG_brutal_realloc, LG_brutal_free, msg) ;
      28          27 :     if (result != 0) return (result) ;
      29             :     #if LAGRAPH_SUITESPARSE
      30             :     // disable the SuiteSparse:GraphBLAS memory pool
      31             :     int64_t free_pool_limit [64] ;
      32          27 :     memset (free_pool_limit, 0, 64 * sizeof (int64_t)) ;
      33          27 :     result = GxB_set (GxB_MEMORY_POOL, free_pool_limit) ;
      34             :     #endif
      35          27 :     return (result) ;
      36             : }

Generated by: LCOV version 1.14