https://issues.dlang.org/show_bug.cgi?id=12060
Johannes Pfau <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Johannes Pfau <[email protected]> --- >return type for hash return type for which function exactly? If you mean the struct finish method: I don't think that's useful. The template digest API is designed in a way to completely avoid memory allocation. You can simply use .idup to get an GC allocated array and we should probably have an .idup(allocator) function or similar for std.allocator. >avoid unnecessary hash copy for Template API I doubt that avoiding a copy in the template API would get some real speed benefits (remember that a ubyte[] slice is already 16 bytes on 64 bit systems, just as big as the complete MD5 hash value). Compilers likely optimize these copies. I think we need some benchmarks which show that copies are a problem here. >it can help to avoid unnecessary memory allocation for OOP API You'd only move the allocation point from OOP API to template API. --
