memreglock implemented, not tested