Update year range in gprofng copyright notices
[binutils-gdb.git] / gprofng / libcollector / memmgr.h
blob0de395acec197c606b83ac6e0ddb4c629ec100a7
1 /* Copyright (C) 2021-2023 Free Software Foundation, Inc.
2 Contributed by Oracle.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
21 #ifndef _MEMMGR_H
22 #define _MEMMGR_H
24 struct Heap;
25 typedef struct Heap Heap;
27 Heap *__collector_newHeap ();
28 void __collector_deleteHeap (Heap *heap);
31 * Initialize memmgr mutex locks.
33 void __collector_mmgr_init_mutex_locks (Heap *heap);
36 * Allocate non-resizable memory.
38 void *__collector_allocCSize (Heap *heap, unsigned sz, int log);
41 * Free non-resizable memory.
43 void __collector_freeCSize (Heap *heap, void *ptr, unsigned sz);
46 * Allocate resizable memory
48 void *__collector_allocVSize (Heap *heap, unsigned sz);
51 * Change size of resizable memory.
52 * ptr - if not NULL, it must have been previously allocated from
53 * the same heap, otherwise returns allocVSize(heap, newsz);
54 * newsz - new size; if 0, memory is freed and no new allocation
55 * occurs;
57 void *__collector_reallocVSize (Heap *heap, void *ptr, unsigned newsz);
59 #endif