Skip to content

Commit d57c303

Browse files
committed
minor review changes
1 parent 4d71191 commit d57c303

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

objectbox/lib/src/native/bindings/flatbuffers.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ class Allocator extends fb.Allocator {
9696
assert(_data[_index] == data);
9797
assert(_allocs[_index].address != 0);
9898

99+
// TODO - there are other options to clear the builder, see how other
100+
// FlatBuffer implementations do it.
99101
memset(_allocs[_index], 0, data.lengthInBytes);
100102
}
101103

@@ -113,7 +115,7 @@ class ReaderWithCBuffer {
113115
// See /benchmark/bin/native_pointers.dart for the max buffer size where it
114116
// still makes sense to use memcpy. On Linux, memcpy starts to be slower at
115117
// about 10-15 KiB. TODO test on other platforms to find an optimal limit.
116-
static const _maxBuffer = 5 * 1024;
118+
static const _maxBuffer = 4 * 1024;
117119
final _bufferPtr = malloc<Uint8>(_maxBuffer);
118120
late final ByteBuffer _buffer = _bufferPtr.asTypedList(_maxBuffer).buffer;
119121

objectbox/lib/src/native/bindings/nativemem.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ typedef _c_memset = Void Function(Pointer<Uint8>, Int32, IntPtr);
2020
typedef _dart_memcpy = void Function(Pointer<Uint8>, Pointer<Uint8>, int);
2121
typedef _c_memcpy = Void Function(Pointer<Uint8>, Pointer<Uint8>, IntPtr);
2222

23-
final DynamicLibrary _stdlib = Platform.isWindows
23+
final DynamicLibrary _stdlib = Platform.isWindows // no .process() on windows
2424
? DynamicLibrary.open('vcruntime140.dll') // required by objectbox.dll
2525
: DynamicLibrary.process();

0 commit comments

Comments
 (0)