Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: incorrect parenthesis in cds_hlist_for_each_entry_safe_2 commit db903109f0031c831e8fdc95cb7197996e53f46d introduced a regression in cds_hlist_for_each_entry_safe_2(): incorrect parenthesis assign "e" to 1, rather than assign "e" to the next pointer, and evaluating the expression to 1 (comma expression). Reported-by: Daniel Thibault <Daniel.Thibault@drdc-rddc.gc.ca> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix undefined NULL pointer arithmetic in hlist Clang 3.3 with -O2 optimisations is especially picky about arithmetic on NULL pointers. This undefined behavior is turned into optimized out NULL checks by clang 3.3. Fix the undefined behavior by checking against the pointer directly, without going back and forth around NULL with pointer arithmetic. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
hlist/rcuhlist update introduce: - cds_hlist_for_each() - cds_hlist_for_each_safe() - CDS_HLIST_HEAD() - CDS_HLIST_HEAD_INIT() - cds_hlist_for_each_entry_2() (takes 3 argument, like the Linux kernel API), - cds_hlist_for_each_entry_safe_2() (takes 4 arguments, like the Linux kernel API), - cds_hlist_for_each_rcu() - cds_hlist_for_each_entry_rcu_2() (takes 3 arguments, like the Linux kernel API). Left cds_hlist_for_each_entry(), cds_hlist_for_each_entry_safe() and cds_hlist_for_each_entry_rcu() as-is (different from the ones found in the Linux kernel) because those APIs were already exposed by Userspace RCU. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Rename all data structure with prefix cds_ This is the third and last patch of the namespace refactoring. The prefix cds_ stands for Concurrent Data Structure and is use for queue, list, hlist and stack. For RCU protected data strucutre, the prefix is also added but the suffix _rcu is appended. This suffix indicate and RCU protection. Signed-off-by: David Goulet <david.goulet@polymtl.ca> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>