« first day (3783 days earlier)      last day (1157 days later) » 

12:52 AM
So I got messed up with a static template <class T> wacky_object_pool<T> pool; global variable. Somehow there are multiple translational units in my code and everything goes down the pooper. But I can't figure out where to put the global external linkage keyword. Is it even possible?
Then wrapping the thing with an "extern "C++" {" doesn't seem to do much of anything...
 
1:27 AM
@CaptainGiraffe 50 in what number base?
 
1:57 AM
Hexadecimal :x
 
@Mikhail can't you just drop an inline on that variable as modern c++ists can?
 
Its already a template and the problem, I think, is that I have two TSs (even though I only compiled one .cpp...) due to some pybind11 compilation magic. For example, my C++ library tester works fine, while when I invoke the library using pybind11 I get weird ODR-like violation errors. So I need to do the opposite.
 
Nonono. Template functions are practically inline, but not variables. But you can make them so. Or am I mistaken and is it reserved for constexpr
 
I think you're right about the template function vs template object, but I made it static which is also like inlining it within the TS?
 
@Mikhail what do you mean by "invoke using pybind11"? You mean, like, you know, import the library? It could well get ODR problems if the python runtime wasn't linked to compatible C runtime I imagine
@Mikhail Nope. Welcome to C++. I think they gave the inline keyword yet another fresh new meaning (we already had inline namespaces right).
I think the goals is for c++27 to have more meanings to inline than static has had to date.
@Mikhail So, stuff you declare static inside a TU (so not in a header) should never be duplicate. If it is so, you're doing something wrong (like getting statically and dynamically linked libs)
Things in a header-file aren't actually different things. File statics shall never "have external linkage" but it doesn't mean you don't different instances in different TU (on the contrary: it is guaranteed).
So, variables defined inline in a header file should be different (I think that's c++17) in that they still guarantee only a single copy. But again, I should check what the scope of this construct is (whether it applies to non-constexpr)
 
2:09 AM
Ah, so basically pybind11 has some cmake wrapper that does some stuff. My (simplified) test code is basically one line where I build my memory pool. So, when I use my header only library in one .cpp file everything works as expected. When I use the cmake pybind11 build target I get what looks like runtime odr problems where the memory pool "changes", somehow. So the constructor populates one memory pool, but the destructor seems to run on empty memory pool...
 
Oh how I hate build system magic.
It's why I stay away from most CMake "modules". I prefer to write what I mean so there aren't nasty surprises
 
I don't quite even understand, might be something like the *.so is relocated at runtime, or some other system internal stuff that I don't understand
 
@Mikhail You should probably be able to trace the pool constructors and see where they get initialized. Also I think Boost Pool (if that's what you're still using) has functions that check whether an object is-from a given pool
 
I wrote a bunch of very performant pools :-)
Somebody should be proud of me :-(
 
@Mikhail It sure would look like one TU is allocating from a global pool, and another TU tells that pool to destroy, but through the joys of weak (or interal.... linkage) they're actually not the same pool
So, let met double check: you said you marked your pool file-static? But there's more than one TU with said pool? Then you have, by definition, separate instances.
A common way to "get to" singletons like this "safely" is via a public, global, function, which is implemented in the TU that has the file-static instance.
 
2:19 AM
So, because I'm not crazy I was only expecting 1 TU per .cpp file. So, the test looks like [pool(), pool.push(),print,pool.pop()~pool()]. When I have a standalone .cpp file everything works. When I use pybind to bake a .so file and I load the module in python (python imports the .so) the test does [pool(), pool.push(),print,* runtime error in ~() because no items are in the pool]
There is probably something about the life cycle of a global variable in a .so file I'm missing
 
2:40 AM
so from within python the pool is empty, even through in a global object I pushed stuff to it, then when the global object's destructor runs it has nothing to pop(), causing a runtime error.
 
 
3 hours later…
5:30 AM
@sehe you are right, can be used for any static storage duration variable
 
 
7 hours later…
12:08 PM
I accidentally did 'gcc ./a.out', then a.out disappeared :x
 
nwp
That wouldn't have happened on Windows. We shall mourn your loss.
 
How do you know that I wasn't on Windows, I could have used putty to login in the server on Windows. But you are right, I used ssh on Mac instead ... ~_~
Did I say server, I meant my raspberry pi.
 
12:36 PM
Hi
 
Yo
 
I'm trying to get rid of old clothes
It's not as easy as I hoped it would be
 
@Morwenn Nostalgia or COVID getting in the way of replacements?
 
12:51 PM
@Mgetz Some of those clothes still look cool even if I'm not wearing them anymore
I'm sorting them because my closet has already been overflowing for at least a year, and chair and bed aren't proper clothes storage devices
 
you could sell them then?
 
I don't have high hopes for that
Plus it's a lot of effort, I'll just ask my cousin (only person I know who isn't taller than me lol) what he wants, give away what's still good enough and throw away what's old and that nobody would take
Oh, and I'm obviously keeping the coolest things until I have more storage issues
At least I can get rid of the trousers I'm too fat to fit anymore x)
 
 
8 hours later…
9:23 PM
weird thought: we use #pragmas to specify and enforce clang-format
 
9:54 PM
@JerryCoffin It varies between 6 and TelKittys suggestion. I haven't decided yet.
@CupOfJava Yes I'm in captivity. Haven't had a solid run-in with a lion since my early teens.
 
10:06 PM
@Mikhail ...and a meta-formatter that will automatically insert the pragmas I want (and a matching filter in the text editor to hide them unless I ask to see them)?
@CaptainGiraffe I try to keep things simpler--I'm always 10 (though the base does vary). Much like string theory, it's infinitely flexible, thus minimizing any possibility of actually transmitting information.
 
10:32 PM
@JerryCoffin I really like to confuse things. The character '5' is curiously loosely defined in my number system.
@JerryCoffin And of course the base or radix if you prefer, does widen as time does its inevitable thing.
 
10:46 PM
@LucDanton Thanks I didn't look it up yet. Those thing pile up in the back of my head
 
@CaptainGiraffe When I was a teenager, I called it radix, but as I've gotten older, I've gotten a lot less radixal.
 
@CaptainGiraffe Happy 60th decimal annum then :)
@JerryCoffin I see evidence to the contrary
 
@sehe What evidence do you have about what I was like as a teenager, back when dinosaurs hadn't yet evolved?
 
I see evidence of punitive radixalism to an extent that I have to assume it's escalating.
 
11:33 PM
@sehe Here's the scary thing: it's really not.
My radixalism is now more puny than punitive.
 
That is properly scary. No wonder they developed the nukes as a retaliatory weapon
 

« first day (3783 days earlier)      last day (1157 days later) »