faster malloc
Moderator: InsideQC Admins
6 posts
• Page 1 of 1
faster malloc
utility library thats seen used in more and more engines nowadays.
look up my ftp ip in general in the mingw compiler thread and grab this nedmalloc.7z if you want to try it out.
upto 125% faster than msvc malloc.
uses the same methods as dlmalloc.
to use in your own engine add nedmalloc.h at the start of quakedef.h
then add this to the compiler defines REPLACE_SYSTEM_ALLOCATOR
and add nedmalloc.lib to libraries.
look up my ftp ip in general in the mingw compiler thread and grab this nedmalloc.7z if you want to try it out.
upto 125% faster than msvc malloc.
uses the same methods as dlmalloc.
to use in your own engine add nedmalloc.h at the start of quakedef.h
then add this to the compiler defines REPLACE_SYSTEM_ALLOCATOR
and add nedmalloc.lib to libraries.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
Ehh, include files shouldn't include other include files. It creates a dependency hell situation, and can make the c preprocessor take longer than necessary, as it would process the same header more than needed.
My 2 cents about that.
My 2 cents about that.
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
-

dreadlorde - Posts: 268
- Joined: Tue Nov 24, 2009 2:20 am
actually for most purposes and intents thats what headers do "besides holding structs etc"
if the idea disgust you that much you can also include the nedmalloc.h header in any file that uses a malloc function but as you might soon discover that includes allmost 90% of the engine
quakedef.h is included by pretty much all the files in quake so if you put it there it will be globally accessible
sort of a win-win situation.
btw the normal way of including nedmalloc is by including its source in whatever project you want to use it on. i just made it a library for convinience.
if the idea disgust you that much you can also include the nedmalloc.h header in any file that uses a malloc function but as you might soon discover that includes allmost 90% of the engine
quakedef.h is included by pretty much all the files in quake so if you put it there it will be globally accessible
btw the normal way of including nedmalloc is by including its source in whatever project you want to use it on. i just made it a library for convinience.
-

revelator - Posts: 2567
- Joined: Thu Jan 24, 2008 12:04 pm
- Location: inside tha debugger
That's what I'm doing with my engine right now, I'm fixing all of the included include files... It's PITA.reckless wrote:if the idea disgust you that much you can also include the nedmalloc.h header in any file that uses a malloc function but as you might soon discover that includes allmost 90% of the engine![]()
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
-

dreadlorde - Posts: 268
- Joined: Tue Nov 24, 2009 2:20 am
dreadlorde wrote:Ehh, include files shouldn't include other include files. It creates a dependency hell situation, and can make the c preprocessor take longer than necessary, as it would process the same header more than needed.
My 2 cents about that.
Well best of luck with GNU stdlib.h then!
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Gahhh, don't remind me..mh wrote:Well best of luck with GNU stdlib.h then!
I may use lunix (I use windows 7 too), but that doesn't mean I like the crap gnu pushes out, or lunix for that matter..
Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Get off my lawn!
-

dreadlorde - Posts: 268
- Joined: Tue Nov 24, 2009 2:20 am
6 posts
• Page 1 of 1
Return to Programming Tutorials
Who is online
Users browsing this forum: No registered users and 1 guest