Email or username:

Password:

Forgot your password?
Top-level
Lennart Poettering

@ldvsoft i am not a fan of those. Static inline funcs suggest inlining to the compiler and we typically want that services call these functions multiple times (ready notification + reload notification at least) hence inlining is the wrong thing. I mean hopefully the compiler figures this out on its own, but given LTO is not pervasively used today there'll be plenty cases where the code wont be reduced to a single copy.

4 comments
ldvsoft

@pid_eins duuuh. Is notify used more than than a couple times anyway to mess up that much?

But I guess you're right that the standard doesn't give us out of the box easy experience to declare I-don't-care-about-address-uniqueness-just-link-it functions. @thephd sorry to bother, is it even a popular use case? I definenelty wrote a couple of static-not-inline function in some internal headers of my projects.

bluca

@ldvsoft @pid_eins @thephd on startup, on reload, on watchdog ping are the most common use cases

ldvsoft

@bluca @pid_eins yeah, those three. I'd think that ready/reload are quite cold on the runtime. Watchdog probably not the hostest thing in the world.

Björkus "No time_t to Die" Dorkus

@ldvsoft @pid_eins It's not an entirely uncommon use case but the fix is to provide a header file and a source file with the usual boilerplate to make it link either statically with a public-visibility function or a DLL with a public-visibility exported entry in the DLL. your distro maintainers will fight over who gets the honor of making it an official dependable package if they care.

Go Up