Interfaces. [Re: Value of microeffiency (was: Re: Optimal ...)]

Steven Ryan smryan at garth.UUCP
Mon Jul 18 05:57:46 AEST 1988


>> Rewrite your interface so that the user must supply the memory for
>> the linked list and free it himself, so that if allocation/deallocation
>> is an issue, the user can handle it.
>
>Then again, I could write it with variable arguments and a global
>control variable that determines whether it does the allocation
>or whether the caller passes allocated memory.
>
>And that requires conditional compilation for those
>who do not want to pull in malloc.

Why not write a whole bunch little interfaces that setup for an attack
from different directions.

Like one interface could call malloc and then pass off to the interface
that assumes the block is a parameter.

Make all the interfaces different functions, different source files if
necessary, and stuff em all into a library. Then only the interfaces
that are actually needed are loaded.

[Libraries? We don't need no steenking libraries. What do you think this is,
Fortran?]

                                  s m ryan
------------------------------------------
They call me Mellow Jello (That's Light!)
They call me Mellow Jello (That's Light!)
They call me Mellow Jello.
                    --cool cos



More information about the Comp.lang.c mailing list