Comments (5)
Right, FfiCallbackMetadata::kPageSize
sdk/runtime/vm/ffi_callback_metadata.h
Lines 205 to 216 in bfe68f9
Could be reused for other things that require a memory block which is at least as large as a page on both host and target.
Moving it to a place where it is reuseable and renaming it sgtm if there's a use for that.
target::kPageSize also should be renamed to target::kHeapPageSize
@rmacnak-google is the one to say something about that.
Maybe @rmacnak-google can also suggest a good name if we move FfiCallbackMetadata::kPageSize
to be reusable (as a page-size that is at least as large as host and target).
fyi @liamappelbe
from sdk.
For now I've also just made all our classes just depend on FfiCallbackMetadata::kPageSize, which is fine. You're welcome to close this if there is no use upstream, thanks.
from sdk.
target::kPageSize also should be renamed to target::kHeapPageSize
No, kHeapPageSize refers to the size of a normal Dart heap chunk. Parts of the GC assume these chunks are also aligned to this value. This value is bigger than the OS page size. The overloading of the term "page" is unfortunate, but common.
from sdk.
I think the real footgun here is that there is a "global" dart::kPageSize (everything is in namespace dart) and then various classes intentionally shadow that kPageSize and end up with confusing (or sometimes wrong) code if they get the wrong size not understanding the shadow.
In any case, we've worked around this by just using FfiCallbackMetadata::kPageSize with our own alias that is named uniquely from kPageSize so there is no risk of getting the wrong one.
We've solved this for us for now, so please feel free to close if not useful to the wider project.
from sdk.
@rmacnak-google is there any actionable item here in terms of moving FfiCallbackMetadata::kPageSize and making a host and target version of it ?
from sdk.
Related Issues (20)
- dart CI: LateInitializationError: Field 'userProperty' has not been initialized HOT 2
- [CP] Handle object literal constructors with no library @JS annotation in dart2js HOT 6
- Uri.parse result with dart2js throws runtime error on -O0, while other levels are OK HOT 2
- Failures on [vm/service]: VM plumbing for Throw.forErrorHandling HOT 2
- pkg/dds/test/dap/integration/dart_test_test Flaky -> RuntimeError
- dart2js minified stack trace is not "de-minifed" in browser by sourcemap HOT 2
- [vm/ffi] Introduce pragma's 'vm:shareable' and 'vm:shared' and make `NativeFinalizer`s live in an isolate group instead of isolate. HOT 7
- Typo and a broken link in the dart2js pragma annotations docs HOT 1
- [analyzer] No quick fix for annotations with static getters HOT 3
- [vm/ffi] Disallow attaching `NativeFinalizer`s to deeply immutable objects HOT 2
- Convert all formal parameters to named doesn't handle super parameters well HOT 3
- Convert all formal parameters to named offered when there are no positional parameters to convert HOT 3
- Convert all formal parameters to named changes optional named parameters to required HOT 2
- [macOS] OS::GetCurrentMonotonicTicks should probably use `CLOCK_UPTIME_RAW`. HOT 6
- Unable to create NativeCallback from function HOT 2
- DevTools server is not robust when it has multiple devtools clients connected to different apps
- Add a concept of trusted clients to the DevTools server HOT 1
- `dart analyze` should use LSP to communicate with analysis server HOT 1
- Analyzer hang related to `string.dart` HOT 2
- generated_plugin_registrant is adding _ to import file 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 sdk.