Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - serprex

Pages: 1 2 3 4 5 6 7
1
Function Peer Review / Re: move_towards_point
« on: January 08, 2011, 02:55:22 PM »
No, they shouldn't

2
Function Peer Review / Re: clamp()
« on: December 14, 2010, 09:02:45 AM »
Get out your minmax, let's go out tonight, it'll be a bang and the whole gang'll rival up on in with the llllllllllittle cherries and sweeeeeeeeeeet comparies. So get out your min(max(x,lower),upper) tonight

3
General ENIGMA / Re: variable_* Functions
« on: December 13, 2010, 09:04:15 AM »
These are better replaced by string indices

4
Off-Topic / Re: Wayland (aka DIE X11 DIE)
« on: November 23, 2010, 08:57:00 AM »
ssh -X

5
Off-Topic / Re: C++0x and garbage collection
« on: November 19, 2010, 12:57:23 PM »
It's standard in C99

6
Announcements / Re: r/coderaid
« on: November 19, 2010, 12:42:58 PM »
Reddit is a bit different than digg. There's a few subreddits which go beyond the upvote/downvote. Coderaid was recently spawned more as a forum

7
Off-Topic / Re: C++0x and garbage collection
« on: November 18, 2010, 07:06:36 PM »
Stack variables are allocated all together. Static variables are not faster than the stack. The stack let's different code reuse the same memory. Keeping variables declared at the inner most scope is best, as it gets reused rather than redefined (Register allocation.) Those two kinds of memory don't suffer fragmentation, and don't have to deal with runtime allocation. This limits pretty close to malloc/free, which becomes close to mmap if you use large blocks which are then partitioned by one's own means. See things like arenas and pools. To understand more about malloc/free, read about free lists

Rusky contends that GC helps cache locality, but preferably one designs their objects to maintain locality by explicitly putting them together in memory, which resolves the issue also. That's the issue I have with people saying that JITs are going to bypass C: In Java, the JIT proves that array bounds are safe, and stops checking. In C, the compiler assumes the array bounds are safe, and doesn't check. One has a JIT to deal with, the other doesn't

Also, Rusky, LLVM doesn't have very good mechanisms for GC. They have some hooks to facillitate a shadow stack, but that says nothing of how much C++'s semantics fail to facillitate garbage collection. Hence Boehm admits that it cannot be standard compliant, only implementation friendly

And at that last part of I still don't know enough about it: Neither is ever always the right. Hence D allows the programmer to disable the GC for some things

8
Off-Topic / Re: C++0x and garbage collection
« on: November 18, 2010, 04:53:20 PM »
Retro,
Firefox has areas where it isn't a memory leak that causes high memory usage, but a large amount of fragementation. If you can't allocate memory in evenly sized blocks without being overly pessimistic so that small objects bloat the memory usage though, then I guess that's your own fault
Really I think the issue is that when people say manual memory management, they think malloc/free. I've been leaning more towards mmap as of late, but then you're outside of standard C. I was recently toying with an explicit memory manager which also had compacting, though the implementation was rather brain dead due to the half ass proof of concept nature of the project. Garbage collection is a design pattern, and where it isn't supplied by the underlying framework, it'll end up being poorly implemented by the application. There are a number of refcounted APIs in C, but refcounting isn't necessarily the superior mechanism. It's only that refcounting is suitable for explicit use by the programmer, as it doesn't deviate much from malloc/free
In any case, you should learn to read Rusky's responses at times. He answered your questions, albeit with hostility. He over evangelizes, but that's what happens when one is forced to play devil's advocate in a crowd

9
Sound and Music / Re: Re: ENIGMA examples - Graphics: 43% done
« on: November 18, 2010, 04:37:50 PM »
Also notice bass/bassmod
As for your other request, see MID2XM. 2MIDI, unfortunately, seems to not freely license itself to freeware

10
Sound and Music / Re: Re: ENIGMA examples - Graphics: 43% done
« on: November 18, 2010, 02:19:47 PM »

11
Proposals / Re: Thoughts on forum registration...
« on: November 06, 2010, 01:15:25 PM »
What does ENIGMA stand for?

12
General ENIGMA / Re: TGMG - A word...
« on: October 19, 2010, 08:15:32 AM »
I like tabs

13
http://gmc.yoyogames.com/index.php?showtopic=90437 39dll is open source, and it shows that making a DLL isn't that hard

14
segment_triangle.cpp: http://en.wikipedia.org/wiki/Fast_inverse_square_root
Code: [Select]
inline void normalize(float* x)
{
float len = 1.0f / sqrtf(dot_product(x, x));
x[0] *= len;
x[1] *= len;
x[2] *= len;
}
He's using inline, so that should deal with aliasing

What's the data set? If you don't have too many values, consider using doubles. If you're alright having 25% useless data thrashing your cache, consider adjusting vectors to be float[4] so to allow for tree vectorization and other such power of two goodness

get_z:
Code: [Select]
if( fabsf(normal[2]) < FUZZY_ZERO )
return 0.0f; // that means that the triangle is parallel to the Z axis (we cannot retrieve a Z value from X and Y)
// Now, the plane equation is A1*x + B1*y + C1*z + D1 = 0
// solving for "z" yields:
// z = -(A1*x + B1*y + D1) / C1
return (normal[0]*x + normal[1]*y - dot_product(normal, va)) / -normal[2];
This is a little epsilon trigger happy. Better would be to check if it is exactly 0, otherwise let the processor give you the nearly zero value (Unless you're using zero as a signal value?). Another case of overly eager number fudging is in line_segment, where if( det > FUZZY_ZERO ) is better stated as a check on whether a01 is near 1

If you're going to use FUZZY_ZERO, consider using -ffast-math

15
char(alpha*255) is undefined if alpha is above 0.5 or below 0

Pages: 1 2 3 4 5 6 7