some untested code to deal with perl hashes
This commit is contained in:
parent
7ff80f37ef
commit
69c513b913
2 changed files with 11 additions and 1 deletions
|
@ -175,6 +175,11 @@ static byte * bytes_SV(SV* sv, STRLEN * sz) {
|
|||
*sz = sizeof(recordid);
|
||||
tmp = (byte*)&valR;
|
||||
code = 'R';
|
||||
} else if (sv_isobject(sv) && sv_derived_from(sv, "Stasis::Hash")) {
|
||||
valR = recordid_SV(sv);
|
||||
*sz = sizeof(recordid);
|
||||
tmp = (byte*)&valR;
|
||||
code = 'H';
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
|
@ -213,6 +218,11 @@ static SV * SV_bytes(byte* bytes, STRLEN sz) {
|
|||
assert(sz-1 == sizeof(recordid));
|
||||
ret = SV_recordid(*(recordid*)bytes);
|
||||
} break;
|
||||
case 'H': {
|
||||
assert(sz-1 == sizeof(recordid));
|
||||
ret = SV_recordid(*(recordid*)bytes);
|
||||
ret = sv_bless(ret, gv_stashpv("Stasis::Hash", GV_ADD));
|
||||
} break;
|
||||
default: {
|
||||
abort();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#ifdef STASIS_BUFFER_MANAGER_FACTORY
|
||||
stasis_buffer_manager_t * stasis_buffer_manager_factory = STASIS_BUFFER_MANAGER_FACTORY;
|
||||
#else
|
||||
stasis_buffer_manager_t * (*stasis_buffer_manager_factory)(stasis_log_t*, stasis_dirty_page_table_t*) = stasis_buffer_manager_hash_factory;
|
||||
stasis_buffer_manager_t * (*stasis_buffer_manager_factory)(stasis_log_t*, stasis_dirty_page_table_t*) = stasis_buffer_manager_concurrent_hash_factory;
|
||||
#endif
|
||||
|
||||
#ifdef BUFFER_MANAGER_O_DIRECT
|
||||
|
|
Loading…
Reference in a new issue