return (size + 7) & ~0x3;
}
+ template <typename Type_>
+ static void delete_(void *data) {
+ reinterpret_cast<Type_ *>(data)->~Type_();
+ }
+
CYPool(const CYPool &);
public:
}
char *strdup(const char *data) {
+ if (data == NULL)
+ return NULL;
return reinterpret_cast<char *>(memdup(data, strlen(data) + 1));
}
}
void atexit(void (*code)(void *), void *data = NULL);
+
+ template <typename Type_>
+ Type_ &object() {
+ Type_ *value(new(*this) Type_());
+ atexit(&delete_<Type_>, value);
+ return *value;
+ }
};
_finline void *operator new(size_t size, CYPool &pool) {