>Zakhar Levchenko wrote: >1. This check is used only to prevent potential crashes if a buggy driver >reports invalid values for parents, just in case. It does not affect >algorithm logic in any way. That's why I called it paranoidal. It may be >totally excluded provided that all parent values are in the range [0..n-1]. >Maybe I missed something, but I can't see any problems here. Can you see any >problems if suppose there's no such check at all? In the previous version (by email) the check was done at the loop condition. I'm saying that there's no advantage for doing it where it's at now, and that I'm not certain falling back to 0 is always correct.
>2. What is the advantage of calloc? In my opinion malloc(n*m) is equivalent >to calloc(n,m) (not fully though since calloc initializes all bits to zero, >but is this advantage?). There's no real advantage save for less code (current code is equivalent since it zeros the array anyway). (completely irrelevant trivia: This is a tiny difference - n*m can overflow. Paranoid OpenBSD switched malloc(n*m) calls to calloc(n, m)). Yours, Yair K. _______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel