diff --git a/lang/perl/Stasis.pm b/lang/perl/Stasis.pm index 5ff0f46..50f295f 100644 --- a/lang/perl/Stasis.pm +++ b/lang/perl/Stasis.pm @@ -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(); } diff --git a/src/stasis/flags.c b/src/stasis/flags.c index 8fc8835..e19f8db 100644 --- a/src/stasis/flags.c +++ b/src/stasis/flags.c @@ -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