Skip to content

Commit b71b6c0

Browse files
committed
Introduce FFIMap typedef
1 parent 11d7701 commit b71b6c0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/NativeScript/Calling/FFICache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ struct SignatureHash {
2929
class FFICache {
3030

3131
public:
32-
std::unordered_map<std::vector<const ffi_type*>, std::shared_ptr<ffi_cif>, SignatureHash> cifCache;
32+
typedef std::unordered_map<std::vector<const ffi_type*>, std::shared_ptr<ffi_cif>, SignatureHash> FFIMap;
33+
FFIMap cifCache;
3334

3435
static FFICache* global();
3536
};

src/NativeScript/Calling/FFICall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void FFICall::initializeFFI(VM& vm, const InvocationHooks& hooks, JSCell* return
7474

7575
std::shared_ptr<ffi_cif> FFICall::getCif(unsigned int nargs, ffi_type* rtype, ffi_type** atypes) {
7676

77-
std::unordered_map<std::vector<const ffi_type*>, std::shared_ptr<ffi_cif>, SignatureHash>::const_iterator it = FFICache::global()->cifCache.find(this->signatureVector);
77+
FFICache::FFIMap::const_iterator it = FFICache::global()->cifCache.find(this->signatureVector);
7878

7979
if (it == FFICache::global()->cifCache.end()) {
8080
std::shared_ptr<ffi_cif> shared(new ffi_cif, deleteCif);
@@ -88,7 +88,7 @@ std::shared_ptr<ffi_cif> FFICall::getCif(unsigned int nargs, ffi_type* rtype, ff
8888
FFICall::~FFICall() {
8989

9090
if (this->_cif.use_count() == 2) {
91-
std::unordered_map<std::vector<const ffi_type*>, std::shared_ptr<ffi_cif>, SignatureHash>::const_iterator it;
91+
FFICache::FFIMap::const_iterator it;
9292
it = FFICache::global()->cifCache.find(this->signatureVector);
9393
FFICache::global()->cifCache.erase(it);
9494
}

0 commit comments

Comments
 (0)