libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libjit] RFC: type safety


From: Alexey Galakhov
Subject: [Libjit] RFC: type safety
Date: Thu, 28 Feb 2013 14:47:09 +0600
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

Hi,

Ok, there have been issues in cache memory manager due to unsafe
typecasts. The worst one was _jit_cache_extend which was declared
returning void but used as returning int. Fortunately its return value
was unused.

I removed virtually all unsafe type handling in cache manager. The patch
is attached. Now there are no more untyped pointers so that the compiler
is able to generate warnings/errors.

I used the following technique:

typedef struct _interface_fake *interface_t;

typedef struct _implementation *implementation_t;
struct _implementation {
   // ...
};

static inline interface_t to_interface(implementation_t x);
static inline implementation_t to_implementation(interface_t x);

Regards,
Alex

Attachment: 0001-Ensure-type-safety-in-memory-manager.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]