-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from objectbox/fb-read-speedup
Read speedup
- Loading branch information
Showing
17 changed files
with
247 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'dart:ffi'; | ||
import 'dart:io'; | ||
|
||
/// Provides native memory manipulation, operating on FFI Pointer<Void>. | ||
/// memset(ptr, value, num) sets the first num bytes of the block of memory | ||
/// pointed by ptr to the specified value (interpreted as an uint8). | ||
final _dart_memset memset = | ||
_stdlib.lookupFunction<_c_memset, _dart_memset>('memset'); | ||
|
||
/// memcpy (destination, source, num) copies the values of num bytes from the | ||
/// data pointed to by source to the memory block pointed to by destination. | ||
final _dart_memcpy memcpy = | ||
_stdlib.lookupFunction<_c_memcpy, _dart_memcpy>('memcpy'); | ||
|
||
// FFI signature | ||
typedef _dart_memset = void Function(Pointer<Uint8>, int, int); | ||
typedef _c_memset = Void Function(Pointer<Uint8>, Int32, IntPtr); | ||
|
||
typedef _dart_memcpy = void Function(Pointer<Uint8>, Pointer<Uint8>, int); | ||
typedef _c_memcpy = Void Function(Pointer<Uint8>, Pointer<Uint8>, IntPtr); | ||
|
||
final DynamicLibrary _stdlib = Platform.isWindows // no .process() on windows | ||
? DynamicLibrary.open('vcruntime140.dll') // required by objectbox.dll | ||
: DynamicLibrary.process(); |
Oops, something went wrong.