Hello, Rick McGuire wrote: > Yes, that probably should be added. OK > Note, however, this code runs on > the client (calling) side, so is not likely the cause of the rxapi > memory overlay error. > > Yes, I just spotted this reviewing the code.
Unfortunately I have absolutely no idea where the memory problem could happens. Does anyone know a good logging library for C++ (like jlog/log5j)?? With something like jlog we could add lots of debugging code with virtually no affect on the speed. There are plenty good libraries for Java but I did not find a good one for C++. > Rick > > Bye Rainer > On Sun, Aug 30, 2009 at 5:16 AM, Rainer Tammer<[email protected]> wrote: > >> Hello, >> I have a question regarding memory allocation in rxapi: >> >> In rexxapi/common/platform/unixSysAPIManager.cpp >> >> void *SysAPIManager::allocateMemory(size_t l) >> { >> return malloc(l); >> } >> >> In rexxapi/clientRegistrationAPI.cpp >> >> void *REXXENTRY RexxAllocateMemory(size_t size) >> { >> return SysAPIManager::allocateMemory(size); >> } >> >> In rexxapi/client/LocalQueueManager.cpp >> >> RexxReturnCode LocalQueueManager::pullFromQueue >> (const char *name, RXSTRING &data, size_t waitFlag, RexxQueueTime >> *timeStamp) >> { >> ... >> if (data.strptr == NULL) >> { >> data.strptr = (char *)RexxAllocateMemory(1); >> } >> >> So if the allocateMemory() fails down the road then an allocation error >> is never checked. >> Even an malloc() call for 1 byte can fail... >> >> Do I miss something here ?? >> >> Should we add an exception here: >> >> if (data.strptr == NULL) >> { >> data.strptr = (char *)RexxAllocateMemory(1); >> if (ddata.strptr == NULL) >> { >> throw new ServiceException(MEMORY_ERROR, >> "LocalQueueManager::pullFromQueue() Failure allocating >> result memory"); >> } >> } >> >> >> >> Bye >> Rainer >> >> ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Oorexx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-devel
