mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 17:35:46 +00:00
ac5e3d38c3
Both `sizeOf` and `AllocatorAlloc.call` use the new type as bound. This prevents runtime errors on trying to call these two static methods with unsized native types. All tests testing for these runtime errors have been deleted. The `NativeTypes` implementing `SizedNativeType` are as follows: * The native integer types, `Float`, and `Double`. * `AbiSpecificInteger` and it's subtypes. * `Struct` and `Union` and their subtypes. The The `NativeTypes` not implementing `SizedNativeType` are as follows: * `Void` has no size. * `Opaque` and subtypes have unknown size. * `Handle` is considered opaque. Cannot be used as field in compounds. * `Array` does not carry a size in its type. Can be used as fields in compounds with an annotation specifying the size. * `NativeFunction` is considered opaque. Would have variable size. * `VarArgs` is only a marker in function signatures. `Struct`s and `Union`s can have only `SizedNativeType`s and `Array`s as fields. Documentation for these is in flux in another CL, so we should update it there. This CL also replaces a bunch of `extends NativeType` with `implements` clauses and made `NativeType` itself `abstract`. TEST=Dart SDK build TEST=ffi test suite Bug: https://github.com/dart-lang/sdk/issues/54542 CoreLibraryReviewExempt: VM and dart2wasm feature only. Change-Id: Ib4f6b58f7204bd063ace20133162798d8c9483e8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345221 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com> |
||
---|---|---|
.. | ||
_http | ||
_internal | ||
_wasm | ||
async | ||
cli | ||
collection | ||
convert | ||
core | ||
developer | ||
ffi | ||
html | ||
indexed_db | ||
internal | ||
io | ||
isolate | ||
js | ||
js_interop | ||
js_interop_unsafe | ||
js_util | ||
math | ||
mirrors | ||
svg | ||
typed_data | ||
vmservice | ||
web_audio | ||
web_gl | ||
web_sql | ||
analysis_options.yaml | ||
libraries.json | ||
libraries.yaml | ||
PRESUBMIT.py | ||
vmservice_libraries.json | ||
vmservice_libraries.yaml |