search for: __alloc

Displaying 10 results from an estimated 10 matches for "__alloc".

Did you mean: __malloc
2016 May 22
2
A "Cross-Platform Runtime Library API" in LLVM IR
...blem. We can assume all of the system calls as runtime functions: such as I/O, allocations etc. and create a set of function implemented for all the architectures. For example, let's think about the mem allocation again: we can provide a primitive function with the same name for all archs (e.g. __alloc() ) and then people can include this function __alloc() in their libraries, inlining it or even renaming it just to fit the frontend needs. And this can be useful: every backend should implement this set of functions ( __alloc(), __free(), __write()… just for example) so the frontends can build a l...
2016 May 23
2
A "Cross-Platform Runtime Library API" in LLVM IR
So, the backend should implement "__alloc" that does the same as "malloc" - or something subtly different from "malloc" - and on a Windows machine, how is it different from "HeapAlloc"? And "__write" that is same as UNIX "write", but different from "WriteFile" in Windows? And...
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
...We can assume all of the system calls as runtime functions: such as I/O, allocations etc. and create a set of function implemented for all the architectures. > For example, let's think about the mem allocation again: we can provide a primitive function with the same name for all archs (e.g. __alloc() ) and then people can include this function __alloc() in their libraries, inlining it or even renaming it just to fit the frontend needs. And this can be useful: every backend should implement this set of functions ( __alloc(), __free(), __write()… just for example) so the frontends can build a l...
2016 May 23
3
A "Cross-Platform Runtime Library API" in LLVM IR
...of functions: > For example > Assuming I need to implement a function which allocates a new object. > The API provides a really basic allocator function I can use to implement the complete function the high-level language needs. > > void *__newobject(int class_size) { > void *r = __alloc(class_size); > // Add GC metadata here > return r; > } You have still completely failed to explain why __alloc() is better than malloc(). If you wish to implement a language-specific allocator like this, then why would it want to call __alloc() from your hypothetical library instead of m...
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
I know but maybe malloc() is a bit higher level than a hypothetical __alloc(), which may be lower-level and then faster. And malloc() is contained in the libc as Matthias said and so maybe a program using malloc() even for a non-C language linking against the crt is needed. I'm just assuming that the functions we use in C such as malloc() are quite high-level interfa...
2016 May 23
3
A "Cross-Platform Runtime Library API" in LLVM IR
On 23 May 2016, at 10:13, Lorenzo Laneve <lore97drk at icloud.com> wrote: > > I know but maybe malloc() is a bit higher level than a hypothetical __alloc(), which may be lower-level and then faster. How? > And malloc() is contained in the libc as Matthias said and so maybe a program using malloc() even for a non-C language linking against the crt is needed. On many *NIX platforms, libc or some equivalent is the canonical interface to the syste...
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
...a C API with implementations of functions: For example Assuming I need to implement a function which allocates a new object. The API provides a really basic allocator function I can use to implement the complete function the high-level language needs. void *__newobject(int class_size) { void *r = __alloc(class_size); // Add GC metadata here return r; } This function will be included in the runtime library. Obviously this is a stupid example maybe a better implementation can be done. Something like this can be done for I/O. > On May 23, 2016, at 11:28 AM, David Chisnall <David.Chisnall at...
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
...or example >> Assuming I need to implement a function which allocates a new object. >> The API provides a really basic allocator function I can use to implement the complete function the high-level language needs. >> >> void *__newobject(int class_size) { >> void *r = __alloc(class_size); >> // Add GC metadata here >> return r; >> } > > You have still completely failed to explain why __alloc() is better than malloc(). If you wish to implement a language-specific allocator like this, then why would it want to call __alloc() from your hypothetica...
2016 May 22
0
A "Cross-Platform Runtime Library API" in LLVM IR
> On May 22, 2016, at 10:31 AM, Lorenzo Laneve via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > > My idea is an API where anyone can build a Runtime Library for any backend, including a set of functions people can inline/rename creating functions the frontend can include in the IR. > > For example implementing a cross-platform runtime function that allocates memory
2016 May 22
2
A "Cross-Platform Runtime Library API" in LLVM IR
My idea is an API where anyone can build a Runtime Library for any backend, including a set of functions people can inline/rename creating functions the frontend can include in the IR. For example implementing a cross-platform runtime function that allocates memory for a new object. (Obviously the library will have to be compiled for each target). I read about compiler-rt but I think it has