The question is about how to use hyperscan database.

I have compile some original databases, and next I want reconstruct them on different memory locations (say, NUMA nodes). To save time of compiling patterns, I just follow steps as below:
  1. compile original databases A, B,  and get their size NA, NB (by hs_database_size)
  2. allocate enough memory (>=(NA+NB)) at new memory locations; the start addresses are AB'
  3. memcpy A to A, and B to B
  4. allocate scratch for A and B
These steps go well, but I have some problems when calling hs_scan:
After long time debugging, I think maybe I shouldnt memcpy database simply like above. 
Do I have to call hs_serialize_XXX  to serialize original databases and then deserialize them on new memory locations?

Thanks for your reply,
Zhao Ziqing