Hydriding behavior of Mg-C nanocomposites