Compiling nedmalloc w/ DMC

Georg Wrede georg at nospam.org
Mon Jan 8 16:05:56 PST 2007


zz wrote:
> Craig Black wrote:
> 
>> I know some D users are interested in nedmalloc so I thought I would post
>> this here as well as in the C++ newsgroup.  BTW, I am very impressed with
>> nedmalloc.  In my C++ code, I gained an overall performance increase of
>> about 15% by using it.
>>
> 
> Here is a dirty solution for compiling nedmalloc with DMC.
> 
> Inside winnt.h add the following:
> typedef enum _HEAP_INFORMATION_CLASS {
>     HeapCompatibilityInformation
> } HEAP_INFORMATION_CLASS;
> 
> Inside winbase.h add the following:
> WINBASEAPI BOOL WINAPI 
> InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION,DWORD);
> 
> 
> compile dmc -o -DNDEBUG -DWIN32 -D_WIN32_WINNT=0x0501 test.c
> 
> I commented out the if(0) and if(1) in test.c just for my test.
> And here are my results.
> 
> Standard DMC allocator:  624583.696090 ops/sec under 2 threads.
> Nedmalloc allocator:    3109062.452439 ops/sec under 2 threads.
> 
> Nedmalloc is 4.977816 times faster than standard.

I' love to see the results of some wider tests between these two.

Does there exist a "de facto standard or standard-like test for memory 
handling in C-like languages"?



More information about the Digitalmars-d mailing list