X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/7341eedbaf526ef2f0986b576c656906050e270a..2c4a8bb6222b88ff96fbf25372179646ce15f706:/Pooling.hpp diff --git a/Pooling.hpp b/Pooling.hpp index b67f262..1c155fe 100644 --- a/Pooling.hpp +++ b/Pooling.hpp @@ -115,6 +115,13 @@ class CYPool { return reinterpret_cast(data); } + template + Type_ *calloc(size_t count, size_t size, size_t alignment = CYAlignment) { + Type_ *data(malloc(count * size, alignment)); + memset(data, 0, count * size); + return data; + } + char *strdup(const char *data) { if (data == NULL) return NULL; @@ -228,6 +235,7 @@ struct CYData { CYData() : count_(1) { + _assert(pool_ != NULL); } CYData(CYPool &pool) :