Comments (1)
I'm fairly certain the C++ standard guarantees that the existing code is correct. Dynamic linkage alone shouldn't affect this unless your compiler or linker has bugs.
I can only imagine three ways this could break:
- If you're doing something weird with threading that makes all variables with static storage duration thread-local (I don't know if that's even possible), then if
empty_block
is called from two different threads, it may result in two different pointers. - If
sherwood_v8_block
is defined differently in two different translation units (e.g. defining certain macros before including the header, or using different versions of the header), it could result in two separate versions of it, breaking ODR. - If you're interpreting an instance of the class in two different ways using casts, you may be calling two separate versions of this function.
If changing the definition as you said actually fixes this, then I think that only the first case could be true.
EDIT: See #26. Depending on how the standard is interpreted, shared objects may not be considered translation units as per the standard's usual definition. Linux has the safer and more conforming behavior, Windows may not. This StackOverflow question explains this in more detail.
from flat_hash_map.
Related Issues (20)
- Compiler warning: Null pointer arithmetic has undefined behavior
- Feature: Use fastrange for hash_policy
- Insert invalidate iterators HOT 3
- optimized clear for trivially_destructable entries
- Iteration Order HOT 1
- Bug
- Is there the project license? HOT 1
- Error building on the MacOS 10.14 SDK HOT 3
- jump_distances won't work with x86 builds
- security
- Bug in flat_hash_map.hpp HOT 1
- Bug: Fails to compile when size_t is not the same size as unsigned long long
- bytell_hash_map: Duplicate item found while traversing map after calling erase() HOT 2
- Creation of default values can be incompatible with convertible_to_value structure
- Usage of static data in empty_default_table causes issues across modules
- Can I use this code in my project? HOT 1
- Corner case issue when hash collision with bad hashing HOT 1
- Merge method
- consider adjust max_lookups linear to the number elements.
- Consider further optimisation on `mod_function`. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flat_hash_map.