set address flags in malloc/zalloc functions
get rid of flags from read/write functions