Hi.
I found serious bug of bcc32. Following code crashes.
#include <stdio.h>
#include <stdlib.h>
int main()
{
for (int i = 0; i < 10000; ++i)
{
void *p = malloc(1048574); // > 1MB?
free(p);
}
}
And following script crashes.
s = "." * 529671
10000.times do |i|
puts i
GC.start
"" << s
end
I recommend for C++Builder user. to apply following patch.
Index: Makefile.sub
===================================================================
RCS file: /src/ruby/bcc32/Makefile.sub,v
retrieving revision 1.42.2.28
diff -u -w -b -p -r1.42.2.28 Makefile.sub
--- Makefile.sub 25 Oct 2005 17:00:01 -0000 1.42.2.28
+++ Makefile.sub 17 Jan 2006 16:57:50 -0000
@@ -125,7 +125,7 @@ RFLAGS = $(iconinc)
!ifndef EXTLIBS
EXTLIBS =
!endif
-LIBS = cw32i.lib import32.lib ws2_32.lib $(EXTLIBS)
+LIBS = usebormm.lib cw32i.lib import32.lib ws2_32.lib $(EXTLIBS)
MISSING = acosh.obj crypt.obj erf.obj win32.obj
!ifndef STACK
This patch tell the program to use borlndmm.dll as memory manager
instead of RTL's internal memory manager which is really buggy.
But for Free compiler user, usebormm.lib, memmgr.lib and borlndmm.dll
are not bundled there, that prevents me from commiting this patch.
Any ideas?