Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!joyce!sri-unix!garth!smryan From: smryan@garth.UUCP (Steven Ryan) Newsgroups: comp.lang.c Subject: Interfaces. [Re: Value of microeffiency (was: Re: Optimal ...)] Summary: My mom was a bozoette in school. Message-ID: <1005@garth.UUCP> Date: 17 Jul 88 19:57:46 GMT References: <163@navtech.uucp> <2775@ttrdc.UUCP> <164@navtech.uucp> <4616@b-tech.UUCP> <472@proxftl.UUCP> <255@chem.ucsd.EDU> <483@proxftl.UUCP> Reply-To: smryan@garth.UUCP (Steven Ryan) Organization: INTERGRAPH (APD) -- Palo Alto, CA Lines: 30 Hero: Tim Benzedrine. Heroine: Hashberry. Slogan: I think we're all bozos on this bus. >> 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