Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!math.fu-berlin.de!fauern!geyer!postnews From: postnews@geyer.UUCP (Postnews) Newsgroups: comp.lang.c++ Subject: Small model malloc() trouble... Message-ID: <649@geyer.UUCP> Date: 9 Apr 91 13:05:35 GMT Reply-To: schoof@sunny.informatik.uni-wuerzburg.dbp.de Organization: University of Wuerzburg, Germany Lines: 23 Hi, folks. We are having a little trouble with a problem I don't dare calling a bug. Using a malloc()-call in small model with a variable size produces bizzare results, if the requested memory size is not an unsigned value. For example cp = (char*)malloc(70000); does not return NULL as you might expect, but reserves about 4500 bytes of memory and returns a pointer to this area. Obviously the value is casted to unsigned implicitly. We are now looking for an elegant(!) way to produce proper results, for example replacing the malloc-routine in CS.LIB (module NearHeap). If anybody out there has already solved this problem, please E-mail me. Solutions for C are not needed (we managed that), but only such for C++ (TC++ 1.01). Thanx, a lot Joscho PLEASE do not reply to the address in the FROM: line, but to SCHOOF@SUNNY.INFORMATIK.UNI-WUERZBURG.DBP.DE