X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/587bbcb1896f084939cb30c4255de18d37eb6f84..0b6f418d7a9f1b8b2bf9330232e45f92d67005a0:/rt/gc/cdgc/dynarray.d diff --git a/rt/gc/cdgc/dynarray.d b/rt/gc/cdgc/dynarray.d index 5a83217..1995b77 100644 --- a/rt/gc/cdgc/dynarray.d +++ b/rt/gc/cdgc/dynarray.d @@ -79,6 +79,14 @@ public: return this._capacity; } + /** + * Get the total ammount of bytes the elements consumes (capacity included). + */ + size_t elements_sizeof() + { + return this._capacity * (T.sizeof + (T*).sizeof); + } + /** * Get the pointer to the array's data. *