2 Copyright (C) 2017 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/>.
23 pool_copy_array_rev (const pool_object * objs, uint32_t len)
27 pool_object *xs = pool_alloc (len);
28 for (int i = 0; i < (int) len; i++)
30 xs[i].type = objs[len - 1 - (unsigned) i].type;
31 xs[i].rest = POOL_PTR (&xs[i + 1]);
32 xs[i].val = objs[len - 1 - (unsigned) i].val;
39 heap_copy_array_rev (const object * objs, uint32_t len)
41 object *xs = heap_alloc (len);
42 for (int i = 0; i < (int) len; i++)
44 xs[i] = objs[len - 1 - (unsigned) i];
46 return HEAP_PTR_OF_OBJECT (xs);