Github user jpeach commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/653#discussion_r68079937 --- Diff: iocore/hostdb/I_HostDBProcessor.h --- @@ -361,7 +361,13 @@ struct HostDBRoundRobin { unsigned short current; ink_time_t timed_rr_ctime; - HostDBInfo info[]; + // This is the equivalent of a variable length array, we can't use a VLA because + // HostDBInfo is a non-POD type-- so this is the best we can do. + HostDBInfo * + info() --- End diff -- Looking at the usage pattern, I think this would be better: ```C HostDBInfo * info(unsigned n) { ... } ``` This lets you avoid the tedious ``info()[n]`` notation, and also lets you check the offset at runtime if necessary (at least a debug assertion should be here).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---