Content-Length: 8845 | pFad | http://lwn.net/Articles/830897/

Supporting Linux kernel development in Rust [LWN.net]
|
|
Subscribe / Log in / New account

Supporting Linux kernel development in Rust

Supporting Linux kernel development in Rust

Posted Sep 8, 2020 5:50 UTC (Tue) by marcH (subscriber, #57642)
Parent article: Supporting Linux kernel development in Rust

> The ubiquitous kmalloc() function, for instance, is defined as __always_inline, meaning that it is inlined into all of its callers and no kmalloc() symbol exists in the kernel symbol table for Rust to link against.

"Inlining" does not imply "no standalone function". These are of course related yet different things. There is a number of cases where a standalone function is created even when the calls are inlined. Simple example from https://gcc.gnu.org/onlinedocs/gcc/Inline.html :

> The function must also be compiled as usual if the program refers to its address, because that cannot be inlined.

Wouldn't a reference to the address of kmalloc() be simpler than "defining a kmalloc_for_rust() symbol containing an un-inlined version"?


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://lwn.net/Articles/830897/

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy