The number of shared memory areas is limited by the allowed virtual address space for a process, which depends on the target architecture.
See the RLIMIT_AS and RLIMIT_DATA resources for setrlimit() in the C Library Reference.