-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 2024-11-01 google3 version
* Now requires abseil-cpp LTS 20240722 * S2Shape derived classes: Add decoding interface with S2Error * S2Error: Interface is now similar to absl::Status, just with a different error code type. In the future, this will probably be replaced by absl::Status. * S2CellId: Made some functions constexpr * S2DensityTree: Improved documentation of weight function * s2edge_crossings: Fix CompareEdges for a case that never happens * Optimize some functions using sincos() when available. * S2Projection: Fix numerical issue * S2Polygon uses new S2LegacyValidQuery to validate geometry. * S2ValidationQuery: New class
- Loading branch information
Showing
204 changed files
with
4,592 additions
and
1,118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright Google Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#include "s2/base/malloc_extension.h" | ||
|
||
#include <cstddef> | ||
#include <new> | ||
|
||
#include "absl/base/attributes.h" | ||
|
||
ABSL_ATTRIBUTE_WEAK ABSL_ATTRIBUTE_NOINLINE size_t nallocx(size_t size, | ||
int) noexcept { | ||
return size; | ||
} | ||
|
||
ABSL_ATTRIBUTE_WEAK ABSL_ATTRIBUTE_NOINLINE __sized_ptr_t | ||
__size_returning_new(size_t size) { | ||
return {::operator new(size), size}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright Google Inc. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS-IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#ifndef S2_BASE_MALLOC_EXTENSION_H_ | ||
#define S2_BASE_MALLOC_EXTENSION_H_ | ||
|
||
// Some s2geometry functions use TCMalloc extensions. Here, we provide | ||
// default implementations so s2geometry can be used with other allocators. | ||
// | ||
// See | ||
// https://github.com/google/tcmalloc/blob/master/tcmalloc/malloc_extension.h | ||
|
||
#include <cstddef> | ||
|
||
extern "C" { | ||
|
||
// `nallocx` performs the same size computation that `malloc` would perform. | ||
// The default weak implementation just returns the `size` argument. | ||
// See https://jemalloc.net/jemalloc.3.html | ||
size_t nallocx(size_t size, int flags) noexcept; | ||
|
||
// `__size_returning_new` returns a pointer to the allocated memory along | ||
// with the (possibly rounded up) actual allocation size used. The default | ||
// weak implementation just returns the requested size. | ||
// This is a TCMalloc prototype of P0901R5 "Size feedback in operator new". | ||
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0901r5.html | ||
struct __sized_ptr_t { | ||
void* p; | ||
size_t n; | ||
}; | ||
__sized_ptr_t __size_returning_new(size_t size); | ||
|
||
} // extern "C" | ||
|
||
#endif // S2_BASE_MALLOC_EXTENSION_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
#define S2_ENCODED_S2CELL_ID_VECTOR_H_ | ||
|
||
#include <cstddef> | ||
|
||
#include <cstdint> | ||
#include <vector> | ||
|
||
|
Oops, something went wrong.