#define _GNU_SOURCE
#endif
-#include <apr_strings.h>
#include "Pooling.hpp"
#include "sig/parse.hpp"
namespace sig {
-void Copy(apr_pool_t *pool, Element &lhs, Element &rhs) {
- lhs.name = apr_pstrdup(pool, rhs.name);
+void Copy(CYPool &pool, Element &lhs, const Element &rhs) {
+ lhs.name = pool.strdup(rhs.name);
if (rhs.type == NULL)
lhs.type = NULL;
else {
lhs.offset = rhs.offset;
}
-void Copy(apr_pool_t *pool, Signature &lhs, Signature &rhs) {
+void Copy(CYPool &pool, Signature &lhs, const Signature &rhs) {
size_t count(rhs.count);
lhs.count = count;
lhs.elements = new(pool) Element[count];
Copy(pool, lhs.elements[index], rhs.elements[index]);
}
-void Copy(apr_pool_t *pool, Type &lhs, Type &rhs) {
+void Copy(CYPool &pool, Type &lhs, const Type &rhs) {
lhs.primitive = rhs.primitive;
- lhs.name = apr_pstrdup(pool, rhs.name);
+ lhs.name = pool.strdup(rhs.name);
lhs.flags = rhs.flags;
- if (sig::IsAggregate(rhs.primitive))
+ if (sig::IsFunctional(rhs.primitive) || sig::IsAggregate(rhs.primitive))
Copy(pool, lhs.data.signature, rhs.data.signature);
else {
sig::Type *&lht(lhs.data.data.type);
- sig::Type *&rht(rhs.data.data.type);
+ sig::Type *const &rht(rhs.data.data.type);
if (rht == NULL)
lht = NULL;
}
}
-void Copy(apr_pool_t *pool, ffi_type &lhs, ffi_type &rhs) {
+void Copy(CYPool &pool, ffi_type &lhs, ffi_type &rhs) {
lhs.size = rhs.size;
lhs.alignment = rhs.alignment;
lhs.type = rhs.type;