This isn't a rock at all, but a seed of Entada Gigas, sometimes called the sea heart or sea bean.
Entada Gigas is called the "sea bean" for good reason: it's a member of the bean family Fabaceae. In fact, this species has the family's largest seed, a flattened heart shape 6 cm in diameter and 2 cm thick. These hollow seeds are washed into the ocean and drift on currents for up to 2 years, on the chance that one will wash up somewhere to germinate. It seems that sea beans have evolved to propagate in this way, similar to coconuts.