logancapaldo
Re:Baby's First Garbage Collector
on Sunday December 08, 2013 @08:22PM (#6872391)
I see. What I was worried about was a version of the code you didn't actually write (casting the ptrdiff_t result to a [u]intptr_t, not casting the pointers first).
Re:Baby's First Garbage Collector
on Sunday December 08, 2013 @05:49PM (#6871828)
What if it's not a DWIM compiler? I'm pretty sure (happy to be corrected) pointer <-> integer conversions are implementation defined. Therefore casting between could perform some reversible operation that ensured round tripping worked, but does not require that ptr(a - b) == a - b even though a == int(ptr(a)) holds.
Re:Exceptions in C with Longjmp and Setjmp
on Sunday March 25, 2012 @09:40AM (#3752560)
That is not a "similar" implementation, and it's not in the "library". It exposes the OS/ABI level exception functionality (which C++ exceptions are also built atop of) to the compiler.
Re:Mastering Threads on MacOS X
on Sunday March 18, 2012 @01:50PM (#3720262)
This article is pretty terrifying:
#import <pthread.h>
#import <stdlib.h>
// Globals
pthread_mutex_t *gLck;
int gSum;
int main (int argc, const char * argv[])
{
pthread_t *tFoo, *tBar;
int tErr, tArgF, tArgB;
// create the mutex construct
tErr = pthread_mutex_init(gLck);
Re:Node-fib: Fast non-blocking fibonacci server
on Monday October 03, 2011 @07:38PM (#3068693)
And this is why, any cache without an eviction policy and/or size limitation is bad (and memoization _is_ a cache). I shudder every time I see a "magical" memoization function whose interface is just
memo function-to-memoize