One can see why the demilune would have been used to hold prisoners. Built as a series of casemated rooms from which defenders could fire upon attackers through loopholes, those walls were plenty stout enough to make it a prison.