[Mesa-dev] main/hash_table.h vs program/hash_table.h

Connor Abbott cwabbott0 at gmail.com
Fri Dec 20 15:53:28 PST 2013


Hi,

While looking at the GLSL IR code, I noticed that different parts of the
code use 2 different hash table implementations. ir_loop_analysis,
ir_variable_refcount, ir_clone, etc. use struct hash_table under
program/hash_table.h, whereas ir_variable_refcount and link_uniform_blocks
use struct hash_table under main/hash_table.h. So more code uses
program/hash_table.h, but it seems based on git blame that
main/hash_table.h is meant to be a replacement and therefore new code
should use that - correct? If so, why was the rest of the code never
converted over? Also, the fact that both versions use the same name (struct
hash_table) seems to me like a potential source of confusion/chaos with
accidentally using the wrong functions. It seems like if we include
main/hash_table.h and program/hash_table.h and then use functions from both
header files on the same structure (for example, using the wrong functions
on the results of an analysis pass), then the compiler won't complain,
leading to all sorts of debugging fun; actually that's something I didn't
even think about until writing this. So why was the name kept the same for
the (apparently) new version?

Thanks,
Connor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131220/07e2c07b/attachment.html>


More information about the mesa-dev mailing list