search for: __newobject

Displaying 4 results from an estimated 4 matches for "__newobject".

Did you mean: js_newobject
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
...(), they use something else. My idea was 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,...
2016 May 23
3
A "Cross-Platform Runtime Library API" in LLVM IR
...gt; My idea was 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; > } 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() fr...
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
2016 May 23
0
A "Cross-Platform Runtime Library API" in LLVM IR
...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; >> } > > 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...