Grok  10.0.3
MemManager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2022 Grok Image Compression Inc.
3  *
4  * This source code is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License, version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This source code is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  *
17  * This source code incorporates work covered by the BSD 2-clause license.
18  * Please see the LICENSE file in the root directory for details.
19  *
20  */
21 #pragma once
22 
23 #if defined(__GNUC__) && !defined(GROK_SKIP_POISON)
24 #pragma GCC poison malloc calloc realloc free
25 #endif
26 
27 #include <cstddef>
28 
29 namespace grk
30 {
31 uint32_t grk_make_aligned_width(uint32_t width);
37 void* grk_malloc(size_t size);
44 void* grk_calloc(size_t numOfElements, size_t sizeOfElements);
50 void* grk_aligned_malloc(size_t size);
51 void grk_aligned_free(void* ptr);
58 void* grk_realloc(void* m, size_t s);
63 void grk_free(void* m);
64 
65 } // namespace grk
Copyright (C) 2016-2022 Grok Image Compression Inc.
Definition: ICacheable.h:20
uint32_t grk_make_aligned_width(uint32_t width)
Definition: MemManager.cpp:35
void grk_free(void *ptr)
Deallocates or frees a memory block.
Definition: MemManager.cpp:96
void * grk_aligned_malloc(size_t size)
Allocate memory aligned to a 16 byte boundary.
Definition: MemManager.cpp:76
void * grk_malloc(size_t size)
Allocate an uninitialized memory block.
Definition: MemManager.cpp:60
void grk_aligned_free(void *ptr)
Definition: MemManager.cpp:80
void * grk_realloc(void *ptr, size_t new_size)
Reallocate memory blocks.
Definition: MemManager.cpp:88
void * grk_calloc(size_t num, size_t size)
Allocate a memory block with elements initialized to 0.
Definition: MemManager.cpp:68