tmpfs is actually the opposite... It uses ram as filesystem space. /dev/shm is used for sharing memory between two processes. I don't really know the details:
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
that's from my gentoo fstab.