ObjFW  Diff

Differences From Artifact [2f06cacc09]:

  • File src/OFObject.m — part of check-in [53defb95a9] at 2012-11-28 19:27:27 on branch trunk — Remove broken forwarding target for ObjFW-RT.

    While it calls the correct method, it does not pass the correct object
    to that code. This would need a trampoline that replaces the object,
    written in assembly for each platform. Therefore, it will be only
    available for some platforms later and the broken code will not come
    back. (user: js, size: 25492) [annotate] [blame] [check-ins using]

To Artifact [df05949c71]:


22
23
24
25
26
27
28


29
30
31
32
33
34
35
#include <stdlib.h>
#include <string.h>

#include <unistd.h>

#include <assert.h>



#ifdef __QNX__
# include <sys/syspage.h>
#endif

#import "OFObject.h"
#import "OFTimer.h"
#import "OFThread.h"







>
>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdlib.h>
#include <string.h>

#include <unistd.h>

#include <assert.h>

#include <sys/time.h>

#ifdef __QNX__
# include <sys/syspage.h>
#endif

#import "OFObject.h"
#import "OFTimer.h"
#import "OFThread.h"
95
96
97
98
99
100
101

102
103
104
105
106
107
108

static struct {
	Class isa;
} alloc_failed_exception;

size_t of_pagesize;
size_t of_num_cpus;


#if !defined(OF_APPLE_RUNTIME) || defined(__OBJC2__)
static void
uncaught_exception_handler(id exception)
{
	fprintf(stderr, "\nRuntime error: Unhandled exception:\n%s\n",
	    [[exception description] UTF8String]);







>







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

static struct {
	Class isa;
} alloc_failed_exception;

size_t of_pagesize;
size_t of_num_cpus;
uint32_t of_hash_seed;

#if !defined(OF_APPLE_RUNTIME) || defined(__OBJC2__)
static void
uncaught_exception_handler(id exception)
{
	fprintf(stderr, "\nRuntime error: Unhandled exception:\n%s\n",
	    [[exception description] UTF8String]);
271
272
273
274
275
276
277














278
279
280
281
282
283
284
# endif
		of_pagesize = 4096;
# ifdef _SC_NPROCESSORS_CONF
	if ((of_num_cpus = sysconf(_SC_NPROCESSORS_CONF)) < 1)
# endif
		of_num_cpus = 1;
#endif














}

+ (void)initialize
{
}

+ alloc







>
>
>
>
>
>
>
>
>
>
>
>
>
>







274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# endif
		of_pagesize = 4096;
# ifdef _SC_NPROCESSORS_CONF
	if ((of_num_cpus = sysconf(_SC_NPROCESSORS_CONF)) < 1)
# endif
		of_num_cpus = 1;
#endif

#if defined(OF_HAVE_ARC4RANDOM)
	of_hash_seed = arc4random();
#elif defined(OF_HAVE_RANDOM)
	struct timeval t;
	gettimeofday(&t, NULL);
	srandom(t.tv_usec);
	of_hash_seed = random();
#else
	struct timeval t;
	gettimeofday(&t, NULL);
	srand(t.tv_usec);
	of_hash_seed = rand();
#endif
}

+ (void)initialize
{
}

+ alloc