xref: /aosp_15_r20/external/brotli/c/common/platform.c (revision f4ee7fba7774faf2a30f13154332c0a06550dbc4)
1*f4ee7fbaSAndroid Build Coastguard Worker /* Copyright 2016 Google Inc. All Rights Reserved.
2*f4ee7fbaSAndroid Build Coastguard Worker 
3*f4ee7fbaSAndroid Build Coastguard Worker    Distributed under MIT license.
4*f4ee7fbaSAndroid Build Coastguard Worker    See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5*f4ee7fbaSAndroid Build Coastguard Worker */
6*f4ee7fbaSAndroid Build Coastguard Worker 
7*f4ee7fbaSAndroid Build Coastguard Worker #include <stdlib.h>
8*f4ee7fbaSAndroid Build Coastguard Worker 
9*f4ee7fbaSAndroid Build Coastguard Worker #include "./platform.h"
10*f4ee7fbaSAndroid Build Coastguard Worker #include <brotli/types.h>
11*f4ee7fbaSAndroid Build Coastguard Worker 
12*f4ee7fbaSAndroid Build Coastguard Worker /* Default brotli_alloc_func */
BrotliDefaultAllocFunc(void * opaque,size_t size)13*f4ee7fbaSAndroid Build Coastguard Worker void* BrotliDefaultAllocFunc(void* opaque, size_t size) {
14*f4ee7fbaSAndroid Build Coastguard Worker   BROTLI_UNUSED(opaque);
15*f4ee7fbaSAndroid Build Coastguard Worker   return malloc(size);
16*f4ee7fbaSAndroid Build Coastguard Worker }
17*f4ee7fbaSAndroid Build Coastguard Worker 
18*f4ee7fbaSAndroid Build Coastguard Worker /* Default brotli_free_func */
BrotliDefaultFreeFunc(void * opaque,void * address)19*f4ee7fbaSAndroid Build Coastguard Worker void BrotliDefaultFreeFunc(void* opaque, void* address) {
20*f4ee7fbaSAndroid Build Coastguard Worker   BROTLI_UNUSED(opaque);
21*f4ee7fbaSAndroid Build Coastguard Worker   free(address);
22*f4ee7fbaSAndroid Build Coastguard Worker }
23