  We use the measured X-ray luminosity function (XLF) of high-mass X-ray
binaries (HMXBs) in nearby star-forming galaxies to constrain the common
envelope (CE) mechanisms, which play a key role in governing the binary
evolution. We find that the XLF can be reproduced quite closely under both CE
mechanisms usually adopted, i.e., the $\alpha_{\rm CE}$ formalism and the
$\gamma$ algorithm, with a reasonable range of parameters considered. Provided
that the parameter combination is the same, the $\gamma$ algorithm is likely to
produce more HMXBs than the $\alpha_{\rm CE}$ formalism, by a factor of up to
$\sim$ 10. In the framework of the $\alpha_{\rm CE}$ formalism, a high value of
$\alpha_{\rm CE}$ is required to fit the observed XLF, though it does not
significantly affect the global number of the HMXB populations. We present the
detailed components of the HMXB populations under the $\gamma$ algorithm and
compare them with those in Zuo et al. and observations. We suggest the distinct
observational properties, as well as period distributions of HMXBs, may provide
further clues to discriminate between these two types of CE mechanisms.
