search for: my_realloc

Displaying 6 results from an estimated 6 matches for "my_realloc".

2012 Jun 05
2
[LLVMdev] alloc_size metadata
...> arguments (not necessarily the same as the as allocation function). > The parameters are given in the metadata as well. > To accommodate the common case, offer_fn can be null, meaning it is > a zero offset. > > The usage would be something like this: > > %r = call i8* @my_realloc(i32* %ptr, i32 %n), !alloc_size !0 > !0 = metadata !{ i32 (i32)* @size, null, i32 %n } > > Even if my_realloc() gets inlined later, the metadata can still be > applied to the returned value (since it is not really specific to a > call site). Of course some parameters of the allo...
2012 Jun 04
0
[LLVMdev] alloc_size metadata
...d they must have the same number of arguments (not necessarily the same as the as allocation function). The parameters are given in the metadata as well. To accommodate the common case, offer_fn can be null, meaning it is a zero offset. The usage would be something like this: %r = call i8* @my_realloc(i32* %ptr, i32 %n), !alloc_size !0 !0 = metadata !{ i32 (i32)* @size, null, i32 %n } Even if my_realloc() gets inlined later, the metadata can still be applied to the returned value (since it is not really specific to a call site). Of course some parameters of the allocation function may be...
2012 Jun 05
0
[LLVMdev] alloc_size metadata
...ssarily the same as the as allocation function). >> The parameters are given in the metadata as well. >> To accommodate the common case, offer_fn can be null, meaning it is >> a zero offset. >> >> The usage would be something like this: >> >> %r = call i8* @my_realloc(i32* %ptr, i32 %n), !alloc_size !0 >> !0 = metadata !{ i32 (i32)* @size, null, i32 %n } >> >> Even if my_realloc() gets inlined later, the metadata can still be >> applied to the returned value (since it is not really specific to a >> call site). Of course some paramet...
2012 Jun 02
5
[LLVMdev] alloc_size metadata
Hi Hal, On 02/06/12 14:28, Hal Finkel wrote: > On Sat, 02 Jun 2012 09:56:30 +0200 > Duncan Sands<baldrick at free.fr> wrote: > >> Hi Hal, >> >>> To do bounds checking you need two things: First you need to know >>> the bounds (this requires tracking calls to allocation functions), >>> and then you need to look at memory accesses. My guess is
2012 Jun 05
3
[LLVMdev] alloc_size metadata
...of > arguments (not necessarily the same as the as allocation function). > The parameters are given in the metadata as well. > To accommodate the common case, offer_fn can be null, meaning it is a > zero offset. > > The usage would be something like this: > > %r = call i8* @my_realloc(i32* %ptr, i32 %n), !alloc_size !0 > !0 = metadata !{ i32 (i32)* @size, null, i32 %n } suppose the size is %n+4. Then in the function you have to compute %s = add i32 %n, 4 and then put %s in the metadata !0 = metadata !{ i32 (i32)* @size, null, i32 %s } However then the only use of %s i...
2012 Jun 05
0
[LLVMdev] alloc_size metadata
...ssarily the same as the as allocation function). >> The parameters are given in the metadata as well. >> To accommodate the common case, offer_fn can be null, meaning it is a >> zero offset. >> >> The usage would be something like this: >> >> %r = call i8* @my_realloc(i32* %ptr, i32 %n), !alloc_size !0 >> !0 = metadata !{ i32 (i32)* @size, null, i32 %n } > > suppose the size is %n+4. Then in the function you have to compute > %s = add i32 %n, 4 > and then put %s in the metadata > !0 = metadata !{ i32 (i32)* @size, null, i32 %s } >...