| Line | Source Code | Coverage |
|---|
| 1 | /* | - |
| 2 | * Copyright (C) 1998-2004 David Turner and Werner Lemberg | - |
| 3 | * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies) | - |
| 4 | * Copyright (C) 2007 Red Hat, Inc. | - |
| 5 | * | - |
| 6 | * This is part of HarfBuzz, an OpenType Layout engine library. | - |
| 7 | * | - |
| 8 | * Permission is hereby granted, without written agreement and without | - |
| 9 | * license or royalty fees, to use, copy, modify, and distribute this | - |
| 10 | * software and its documentation for any purpose, provided that the | - |
| 11 | * above copyright notice and the following two paragraphs appear in | - |
| 12 | * all copies of this software. | - |
| 13 | * | - |
| 14 | * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR | - |
| 15 | * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES | - |
| 16 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN | - |
| 17 | * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | - |
| 18 | * DAMAGE. | - |
| 19 | * | - |
| 20 | * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, | - |
| 21 | * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | - |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS | - |
| 23 | * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO | - |
| 24 | * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | - |
| 25 | * | - |
| 26 | * Red Hat Author(s): Behdad Esfahbod | - |
| 27 | */ | - |
| 28 | | - |
| 29 | #include "harfbuzz-impl.h" | - |
| 30 | | - |
| 31 | | - |
| 32 | HB_INTERNAL HB_Pointer | - |
| 33 | _hb_alloc(size_t size, | - |
| 34 | HB_Error *perror ) | - |
| 35 | { | - |
| 36 | HB_Error error = (HB_Error)0; executed (the execution status of this line is deduced): HB_Error error = (HB_Error)0; | - |
| 37 | HB_Pointer block = NULL; executed (the execution status of this line is deduced): HB_Pointer block = ((void *)0); | - |
| 38 | | - |
| 39 | if ( size > 0 ) evaluated: size > 0| yes Evaluation Count:402351 | yes Evaluation Count:10041 |
| 10041-402351 |
| 40 | { | - |
| 41 | block = calloc( 1, size ); executed (the execution status of this line is deduced): block = calloc( 1, size ); | - |
| 42 | if ( !block ) partially evaluated: !block| no Evaluation Count:0 | yes Evaluation Count:402351 |
| 0-402351 |
| 43 | error = ERR(HB_Err_Out_Of_Memory); never executed: error = _hb_err (HB_Err_Out_Of_Memory); | 0 |
| 44 | } executed: }Execution Count:402351 | 402351 |
| 45 | | - |
| 46 | *perror = error; executed (the execution status of this line is deduced): *perror = error; | - |
| 47 | return block; executed: return block;Execution Count:412392 | 412392 |
| 48 | } | - |
| 49 | | - |
| 50 | | - |
| 51 | HB_INTERNAL HB_Pointer | - |
| 52 | _hb_realloc(HB_Pointer block, | - |
| 53 | size_t new_size, | - |
| 54 | HB_Error *perror ) | - |
| 55 | { | - |
| 56 | HB_Pointer block2 = NULL; executed (the execution status of this line is deduced): HB_Pointer block2 = ((void *)0); | - |
| 57 | HB_Error error = (HB_Error)0; executed (the execution status of this line is deduced): HB_Error error = (HB_Error)0; | - |
| 58 | | - |
| 59 | block2 = realloc( block, new_size ); executed (the execution status of this line is deduced): block2 = realloc( block, new_size ); | - |
| 60 | if ( block2 == NULL && new_size != 0 ) partially evaluated: block2 == ((void *)0)| no Evaluation Count:0 | yes Evaluation Count:572 |
never evaluated: new_size != 0 | 0-572 |
| 61 | error = ERR(HB_Err_Out_Of_Memory); never executed: error = _hb_err (HB_Err_Out_Of_Memory); | 0 |
| 62 | | - |
| 63 | if ( !error ) partially evaluated: !error| yes Evaluation Count:572 | no Evaluation Count:0 |
| 0-572 |
| 64 | block = block2; executed: block = block2;Execution Count:572 | 572 |
| 65 | | - |
| 66 | *perror = error; executed (the execution status of this line is deduced): *perror = error; | - |
| 67 | return block; executed: return block;Execution Count:572 | 572 |
| 68 | } | - |
| 69 | | - |
| 70 | | - |
| 71 | HB_INTERNAL void | - |
| 72 | _hb_free( HB_Pointer block ) | - |
| 73 | { | - |
| 74 | if ( block ) partially evaluated: block| yes Evaluation Count:397495 | no Evaluation Count:0 |
| 0-397495 |
| 75 | free( block ); executed: free( block );Execution Count:397495 | 397495 |
| 76 | } executed: }Execution Count:397495 | 397495 |
| 77 | | - |
| 78 | | - |
| 79 | /* helper func to set a breakpoint on */ | - |
| 80 | HB_INTERNAL HB_Error | - |
| 81 | _hb_err (HB_Error code) | - |
| 82 | { | - |
| 83 | return code; never executed: return code; | 0 |
| 84 | } | - |
| 85 | | - |
| | |