Skip to content

Commit

Permalink
Remove HAVE_WORD_ALIGNMENT config option
Browse files Browse the repository at this point in the history
  • Loading branch information
mmd-osm committed Sep 6, 2023
1 parent b7ca635 commit f69e9c3
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 35 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ option(HAVE_LZ4 "Build with lz4 library" ON)
option(HAVE_OPENMP "Build with OpenMP" ON)
option(HAVE_ANKERL "Build with ankerl::unordered_dense::* library" OFF)
option(BUILD_TESTS "Build test suite" OFF)
option(HAVE_WORD_ALIGNMENT "Build some structures as packed with 4-byte alignment" OFF)
option(USE_UNITY_BUILD "Enable Unity Build" OFF)
option(ENABLE_INSTALL "Enable installation" ON)
option(OSMIUM_WITH_LZ4 "Enable lz4 support for libosmium" ON)
Expand Down
1 change: 0 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ Example syntax for changeset 46503970: (syntax is subject to change)
Note: POSIX regular expressions still require additional copying due to API limitations.
- Key value queries to validate first element of a new index only. Immediately skip all elements, in case key value pairs are not matching.
- Replace std::map based user data cache by std::vector, also avoid expensive sorting operations for millions of user id/display_name pairs.
- Added cmake option for packed, 4 byte aligned structs for some frequently used core data types (Nodes, Way, Relations, Areas). Requires clang++ (experimental)
- Use monobound_binary_search instead of std::binary_search for some hot code paths.
- Make updater and backend use std::vector instead of std::set, and std::unordered_map instead of std::map
- Added multi-threaded processing in updater
Expand Down
1 change: 0 additions & 1 deletion cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#cmakedefine HAVE_OPENMP 1
#cmakedefine HAVE_ICU 1
#cmakedefine HAVE_OVERPASS_XML 1
#cmakedefine HAVE_WORD_ALIGNMENT 1
#cmakedefine HAVE_ANKERL 0
#cmakedefine OSMIUM_WITH_LZ4 1
#cmakedefine HAVE_LIBOSMIUM ${HAVE_LIBOSMIUM}
Expand Down
6 changes: 1 addition & 5 deletions src/overpass_api/core/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,7 @@ template <class T, class Object, class Element_Skeleton>
struct Attic_Handle_Methods;

template< typename Element_Skeleton >
struct
#ifdef HAVE_WORD_ALIGNMENT
__attribute__ ((packed, aligned(4)))
#endif
Attic : public Element_Skeleton
struct Attic : public Element_Skeleton
{
static_assert(!is_base_of_any< Attic , Element_Skeleton >::value, "Nested attic: Element_Skeleton may not be an Attic struct itself");

Expand Down
10 changes: 1 addition & 9 deletions src/overpass_api/core/type_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ struct Node_Equal_Id {
template <class T, class Object>
struct Node_Skeleton_Handle_Methods;

struct
#ifdef HAVE_WORD_ALIGNMENT
__attribute__ ((packed, aligned(4)))
#endif
Node_Skeleton
struct Node_Skeleton
{
typedef Node::Id_Type Id_Type;
typedef Node_Skeleton Delta;
Expand Down Expand Up @@ -154,10 +150,6 @@ Node_Skeleton
using Handle_Methods = Node_Skeleton_Handle_Methods<T, Object>;
};

#ifdef HAVE_WORD_ALIGNMENT
static_assert(sizeof(Node_Skeleton) == 12, "Node_Skeleton has wrong size");
#endif


template <class T, class Object>
struct Node_Skeleton_Handle_Methods
Expand Down
6 changes: 1 addition & 5 deletions src/overpass_api/core/type_relation.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,7 @@ class Relation_Skeleton_Data final : public SharedData
};


struct
#ifdef HAVE_WORD_ALIGNMENT
__attribute__ ((packed, aligned(4)))
#endif
Relation_Skeleton
struct Relation_Skeleton
{
typedef Relation::Id_Type Id_Type;
typedef Relation_Delta Delta;
Expand Down
15 changes: 2 additions & 13 deletions src/overpass_api/core/type_way.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ struct Way_Delta;
template <class T, class Object>
struct Way_Skeleton_Handle_Methods;

class
#ifdef HAVE_WORD_ALIGNMENT
__attribute__ ((packed, aligned(4)))
#endif
Way_Skeleton_Data final : public SharedData
class Way_Skeleton_Data final : public SharedData
{
public:
Way_Skeleton_Data() = default;
Expand All @@ -117,11 +113,7 @@ Way_Skeleton_Data final : public SharedData
std::vector< Quad_Coord > geometry;
};

struct
#ifdef HAVE_WORD_ALIGNMENT
__attribute__ ((packed, aligned(4)))
#endif
Way_Skeleton
struct Way_Skeleton
{
typedef Way::Id_Type Id_Type;
typedef Way_Delta Delta;
Expand Down Expand Up @@ -216,9 +208,6 @@ Way_Skeleton
SharedDataPointer<Way_Skeleton_Data> d;
};

#ifdef HAVE_WORD_ALIGNMENT
static_assert(sizeof(Way_Skeleton) == 12, "Way_Skeleton has wrong size");
#endif


template <class T, class Object>
Expand Down

0 comments on commit f69e9c3

Please sign in to comment.