dmd 1.057 and 2.041 release

grauzone none at example.net
Tue Mar 9 02:29:42 PST 2010


Robert Jacques wrote:
> On Mon, 08 Mar 2010 16:42:54 -0500, Philippe Sigaud 
> <philippe.sigaud at gmail.com> wrote:
> 
>> On Mon, Mar 8, 2010 at 14:22, Steven Schveighoffer 
>> <schveiguy at yahoo.com>wrote:
>>
>>> The shrinkToFit name is not my favorite, anyone care to submit a better
>>> name?  minimize is out because it has connotations of math already.
>>>
>>
>> minCapacity
>> minimizeCapacity
>> shrinkCapacity
>> shrink (just shrink)
>> releaseCapacity
>> compacify
>> fitCapacity
>> minFit???
>> reduceToFit
>> contract
>> minify
>> adjust
>>
>>
>>
>> Philippe
> 
> compact

Many of these names (including shrinkToFit) suggest that memory usage is 
reduced by freeing the left over memory after the array. This is not 
true: the function just enables stomping of the memory past the slice 
passed to the function.

It's a very specialized and dangerous function (but still may be 
critical for good performance), and maybe it should rather have a more 
convoluted/long name than a simple one.


More information about the Digitalmars-d-announce mailing list