]> www.ginac.de Git - cln.git/blob - src/base/cl_alloca.cc
- Compatibility was not really broken, so: C=0, R=1, A=0.
[cln.git] / src / base / cl_alloca.cc
1 // cl_alloc_alloca_header(), cl_free_alloca_header().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_alloca.h"
8
9
10 // Implementation.
11
12 #include "cl_malloc.h"
13 #include "cl_offsetof.h"
14
15 cl_alloca_header* cl_alloc_alloca_header (size_t size)
16 {
17         var cl_alloca_header* pointer =
18           (cl_alloca_header*)cl_malloc_hook(size+offsetofa(cl_alloca_header,usable_memory));
19         pointer->next = NULL;
20         return pointer;
21 }
22
23 void cl_free_alloca_header (cl_alloca_header* pointer)
24 {
25         do {
26                 cl_alloca_header* next = pointer->next;
27                 cl_free_hook(pointer);
28                 pointer = next;
29         } while (pointer != NULL);
30 }