2 Copyright (C) 2017-2018 Keziah Wesley
4 You can redistribute and/or modify this file under the terms of the
5 GNU Affero General Public License as published by the Free Software
6 Foundation, either version 3 of the License, or (at your option) any
9 This file is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Affero General Public License for more details.
14 You should have received a copy of the GNU Affero General Public
15 License along with this file. If not, see
16 <http://www.gnu.org/licenses/>.
26 typedef uint32_t pool_ptr;
27 typedef int32_t heap_ptr;
29 typedef union pool_object pool_object;
30 typedef union object object;
32 pool_object *POOL_OBJECT (pool_ptr p);
33 object *HEAP_OBJECT (heap_ptr p);
35 pool_ptr pool_alloc (uint32_t len);
36 heap_ptr heap_alloc (uint32_t len);
38 // given a headerless array of objects of known size,
39 // copy it backwards into newly-allocated pool space
40 pool_ptr pool_copy_array_rev (const pool_object *objs, uint32_t len);
41 heap_ptr heap_copy_array_rev (const object *objs, uint32_t len);