Re: Malloc code

Tech-Archive recommends: Speed Up your PC by fixing your registry



On Fri, 28 Dec 2007 13:58:02 -0800, Robby
<Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hello,

To the ones that are familliar with my previous post entitled ("Simple
question about headers and malloc") ( hummm not as simple as *I* thought!) ,
here are a few things to keep in mind.


Hi,

I suggest adding checks of function arguments in each function. Add
asserts to make sure that you get the expected values and that they
are in range. This could be done also at function exit in each
function. This will help your fellow colleagues later when they change
the code as well.

Also whenever you have arguments to functions that are not changed,
declare them as const. That is easier for others to read and
understand.

hth/ajk
.



Relevant Pages