![]() |
【转帖】memory management - odrxallocodrxrealloc
memory management - odrxalloc/odrxrealloc
memory management - odrxalloc/odrxrealloc i have provided my own implementation of the the odalloc.h functions: odrxalloc and odrxrealloc. if my custom implementation cannot allocate memory for some reasons, should i be throwing an oderror(eoutofmemory) exception? however these are defined in extern "c" block in the header file odalloc.h. this means i am not supposed to throw from them(as expected there's a warning by vc compiler if i do so). should i just return null if my odrxalloc and odrxrealloc fail?? tia alex. odrxalloc and odrxrealloc functions are analgous to ::malloc/::free pair, and should not throw exceptions. (but, your overloaded "new" operator should throw exception if allocation fails) vladimir |
所有的时间均为北京时间。 现在的时间是 10:49 AM. |