added sharedinit and sharedalloc