• R/O
  • SSH
  • HTTPS

eirrepo: Commit


Commit MetaInfo

Revision116 (tree)
Time2018-09-06 04:17:33
Authorquiret

Log Message

- fixed some weird behavior of Realloc, made it behave exactly as the documentation states

Change Summary

Incremental Difference

--- common/sdk/OSUtils.memheap.h (revision 115)
+++ common/sdk/OSUtils.memheap.h (revision 116)
@@ -337,9 +337,10 @@
337337
338338 if ( newMemPtr == nullptr )
339339 {
340- // DESTROY!
341- // There is no recovery for impartial failure.
342- Free( memPtr );
340+ // We follow the guide as to what happens when "realloc fails"...
341+ // https://linux.die.net/man/3/realloc
342+ // You can detect this case when you passed in a positive value
343+ // for request size but this function returns nullptr.
343344 return nullptr;
344345 }
345346
Show on old repository browser