* Space allocation and freeing routines for use by zlib routines. */
| 49 | * Space allocation and freeing routines for use by zlib routines. |
| 50 | */ |
| 51 | void* z_alloc(void* notused __unused, u_int num_items, u_int size) |
| 52 | { |
| 53 | void* result = NULL; |
| 54 | z_mem* zmem = NULL; |
| 55 | UInt32 total = num_items * size; |
| 56 | UInt32 allocSize = total + sizeof(zmem); |
| 57 | |
| 58 | zmem = (z_mem*)IOMalloc(allocSize); |
| 59 | |
| 60 | if (zmem) |
| 61 | { |
| 62 | zmem->alloc_size = allocSize; |
| 63 | result = (void*)&(zmem->data); |
| 64 | } |
| 65 | |
| 66 | return result; |
| 67 | } |
| 68 | |
| 69 | void z_free(void* notused __unused, void* ptr) |
| 70 | { |
nothing calls this directly
no outgoing calls
no test coverage detected