Review: * add comments * change error code from assertion to proper memory failure * add new assertions
Review:
* add comments
* change error code from assertion to proper memory failure
* add new assertions

P-p-H-d/mlib,P-p-H-d/mlib