simplify alloc.
remove redundant asserts.
fix: unnecessary casts.
add an assert.
add const.
add const.
a bit fix.
Merge branch 'review-work' into develop