Skip to content

Commit

Permalink
circumvent flutter AOT precompiler error
Browse files Browse the repository at this point in the history
  • Loading branch information
vaind committed Mar 31, 2021
1 parent 32a922e commit 9d9743d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions objectbox/lib/src/native/bindings/flatbuffers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ class Allocator extends fb.Allocator {
.lookupFunction<_c_memset, _dart_memset>('memset');
} catch (_) {
// fall back if we can't load a native memset()
fbMemset = (Pointer<Uint8> ptr, int byte, int size) {
final bytes = ptr.cast<Uint8>();
for (var i = 0; i < size; i++) {
bytes[i] = byte;
}
};
fbMemset = (Pointer<Uint8> ptr, int byte, int size) =>
ptr.cast<Uint8>().asTypedList(size).fillRange(0, size, 0);
}
} else {
fbMemset = DynamicLibrary.process()
Expand Down

0 comments on commit 9d9743d

Please sign in to comment.