X-Git-Url: https://git.llucax.com/software/dgc/cdgc.git/blobdiff_plain/587bbcb1896f084939cb30c4255de18d37eb6f84..6a3232d8f1c52377e792b4f4e18fd75f2a3b0f60:/rt/gc/cdgc/dynarray.d?ds=sidebyside diff --git a/rt/gc/cdgc/dynarray.d b/rt/gc/cdgc/dynarray.d index 5a83217..feddd98 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 array consumes. + */ + size_t size_of() + { + return this.sizeof + this._capacity * (T.sizeof + (T*).sizeof); + } + /** * Get the pointer to the array's data. *