GRPC Core  43.0.0
alloc.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_SUPPORT_ALLOC_H
20 #define GRPC_SUPPORT_ALLOC_H
21 
22 #include <stddef.h>
23 
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
35 GPRAPI void* gpr_malloc(size_t size);
37 GPRAPI void* gpr_zalloc(size_t size);
39 GPRAPI void gpr_free(void* ptr);
41 GPRAPI void* gpr_realloc(void* p, size_t size);
44 GPRAPI void* gpr_malloc_aligned(size_t size, size_t alignment);
46 GPRAPI void gpr_free_aligned(void* ptr);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif /* GRPC_SUPPORT_ALLOC_H */
gpr_malloc
GPRAPI void * gpr_malloc(size_t size)
malloc.
gpr_free_aligned
GPRAPI void gpr_free_aligned(void *ptr)
free memory allocated by gpr_malloc_aligned
gpr_realloc
GPRAPI void * gpr_realloc(void *p, size_t size)
realloc, never returns NULL
gpr_free
GPRAPI void gpr_free(void *ptr)
free
gpr_malloc_aligned
GPRAPI void * gpr_malloc_aligned(size_t size, size_t alignment)
aligned malloc, never returns NULL, will align to alignment, which must be a power of 2.
gpr_zalloc
GPRAPI void * gpr_zalloc(size_t size)
like malloc, but zero all bytes before returning them
GPRAPI
#define GPRAPI
Definition: port_platform.h:721
port_platform.h