change the sharememory define, and fix bug in linux