Loading ...
Sorry, an error occurred while loading the content.

80443Re: [XP] Necessary comments?

Expand Messages
  • Ron Jeffries
    Oct 2, 2003
      On Wednesday, October 1, 2003, at 10:34:17 PM, Robert Blum wrote:

      > The code in question is

      > /* We could've used callChain instead, but we don't know
      > * if there is any room in the DMA call stack left */
      > masterChain.appendChain(someCommandChain);

      > That comment is there since 'callChain' would be the more intuitive
      > approach - usually we know if there's room left in the call stack. We
      > just don't in this particular case.

      > I can't check it, either - that would cost too much performance.

      First some things I'm just wondering about:

      Does appendChain not have a performance hit over callChain? Or is that
      done in some other thread or something that doesn't matter? I understand
      that you need to scrape every cycle out, but would have thought that the
      check wasn't very costly at all. Anyway, just wondering, not objecting.

      For a fix, I'd consider renaming or aliasing appendChain (I suppose I
      couldn't wrap it, that would cost an entire method call oh god) to
      something like stackSizeUnknownChain(). Now /that/ method might need a
      comment, but there'd be only one, and we programmers would quickly learn to
      use this method when the stack size is ... unknown.

      > Any suggestions how to express this better in code are appreciated.

      Just musing ...

      Ron Jeffries
      You can observe a lot by watching. --Yogi Berra
    • Show all 19 messages in this topic