Re: New Rule Suggestion
- From: Anders Isaksson <anders.isaksson@xxxxxxxxxxxx>
- Date: Tue, 31 May 2005 08:22:56 +0200
On Mon, 30 May 2005 20:05:10 +0200, "Dennis"
<marianndkc@xxxxxxxxxxxxxxx> wrote:
>I would like us to discuss a new rule.
>
>"A function returning a string as result must allocate enough memory for
>that string and not more"
Why? What's the point of this rule? Which problem does it remove?
If an algorithm can be made faster by allocating a bit more memory than
the final Result will need, what's the problem? Thats a valid solution
to boundary problems (sentinel values instead of repeatedly checking the
index, for example).
Or will the extra memory be orphaned? If so a validation would show
memory leaks, right?
--
Anders Isaksson, Sweden
BlockCAD: http://web.telia.com/~u16122508/proglego.htm
Gallery: http://web.telia.com/~u16122508/gallery/index.htm
.
- References:
- New Rule Suggestion
- From: Dennis
- New Rule Suggestion
- Prev by Date: Re: Fastcode UpperCase B&V 2.8
- Next by Date: Re: Fastcode UpperCase B&V 2.8
- Previous by thread: New Rule Suggestion
- Next by thread: Re: New Rule Suggestion
- Index(es):
Relevant Pages
|