Cocaine acts as a stimulant, whereas heroin/morphine acts as a depressant.
Because the stimulant effects of cocaine wear off far more quickly than the depressant effects of heroin or morphine, fatal respiratory depression often occurs when the full effects of a heroin or morphine overdosage are felt in isolation.