|
In France, we have one provider who lets you connect to WiFi from other access points in the neighbourhood for such cases. It is quite slow, but comes very handy.
|
|
|
|
|
I need to implement two functions on an apple machine
One to map a file into process address space using vmem
One to unmap said file
And then I need to test it.
I do not own an apple, and i never will.
But I'd like to at least support a major optimization for the platform.
Real programmers use butterflies
|
|
|
|
|
You might try a rantal service. Your local office supply house might have a line to one.
For that matter, your local Apple store might be willing to let you 'borrow' a refurb machine or something like that with a handshake and $100 cash.
Software Zen: delete this;
|
|
|
|
|
There's an idea. I'll just walk in and be like, "what do i have to do to get a machine with a clang compiler on it for about an hour?" and enjoy the looks I get.
Real programmers use butterflies
|
|
|
|
|
Seems to me that Xamarin had an emulator?
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
Interesting. It wouldn't allow me to benchmark though, so I'm not sure how well i could test my code. The point of it is to speed up my processor on apple machines. I want to be sure that is working. on an emulator i'm not sure i could be. plus i thought xamarin was managed stuff.
I'm trying to call OS level functions from C++
Real programmers use butterflies
|
|
|
|
|
Does it need to be a mac? Would a VM running darwin do?
Keep Calm and Carry On
|
|
|
|
|
can i compile with clang and test apple's virtual memory mapped file functions mmap() and munmap () from C++ with it?
virtual memory functions from C++[^]
Building something using and running that is what i need to test.
Real programmers use butterflies
|
|
|
|
|
Sure. mmap() and munmap() are POSIX standard calls, so any of the *BSD variants should work. FreeBSD and OpenBSD use clang as the default compiler. Since these are POSIX calls, they should work the same on any POSIX compliant system, including Linux. They're certainly available in glibc-2.3 (circa 2002). You could install clang on your Linux distribution, but since mmap() and munmap() are provided by libc, changing the compiler should not affect the availability or behaviour of the calls.
Keep Calm and Carry On
|
|
|
|
|
Well, forget Darwin in a VM, I think. It would seem that "official" darwin iso's are no longer available. There is PureDarwin, but that's still in beta, though it's supposed to be a downstream version of Apple-Darwin.
It looks like you may have solved your issue with MacInCloud. But you might be able to shorten the time you need to rent there by installing a FreeBSD instance in a VM and doing 99.9% of conformance testing there, then do the final bit on MacInClout.
Keep Calm and Carry On
|
|
|
|
|
That's a good idea, but I probably don't need to do it. From the looks of it, apple and linux use the same, or nearly the same calls, so i think i might have to copy, paste compile, remove the pasted bit and update my #if defined(__linux__) to be #if defined(__linux__) || defined(_APPLE_) or whatever. That's the hope anyway, but I won't know for sure until i compile it on an apple machine.
Real programmers use butterflies
|
|
|
|
|
i have clang installed. I didn't realize those calls were posix. thanks!
Real programmers use butterflies
|
|
|
|
|
actually, since I'm here, you wouldn't happen to know the best way to #ifdef that into my code would you?
The posix check for mmap support i mean, for example, #if __POSIX_MAJOR > 3
or something.
Real programmers use butterflies
|
|
|
|
|
I'd be tempted to go the other way around and do
#if defined( _WIN64 ) || defined( _WIN32 )
#else if defined( <arduino def>)
#else
#endif
That assumes that anything not Windows or arduino is POSIX, of course. And, as noted above, the mmap calls go back to almost 20 years, so anything that is anything unixish and is less that that old probably supports mmap() munmap().
Of course, if that doesn't float your boat, in the CONFORMING TO section of the mmap man page it states Quote: On POSIX systems on which mmap(), msync(2), and munmap() are available, _POSIX_MAPPED_FILES is defined in <unistd.h> to a
value greater than 0.
So that might be the best way to go. I've confirmed the presence of _POSIX_MAPPED_FILES in unistd.h in FreeBSD, NetBSD, OpenBSD and even the oldest Linux I can find, e.g. RedHat 5 (Manhattan (c)1997, not RHEL-5)
Keep Calm and Carry On
|
|
|
|
|
I didn't know about _POSIX_MAPPED_FILES. Thanks!
However, one wrinkle I'm working on now is knowing when to include unistd.h. There's no way to tell if it's even available.
At that point I may have to do #if defined(_APPLE) || defined(__unix) // or whatever it is
I don't want posix as fallback. I want no mapped files, and just stdlib as fallback
Real programmers use butterflies
|
|
|
|
|
Actually, Apple machines need not be so expensive. You can buy them on Amazon for a mere $20[^]
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
|
|
|
|
|
I will never own an apple device on principle.
Real programmers use butterflies
|
|
|
|
|
My policy has always been to not give Apple any money, ever.
I've worked around my own policy a few years ago by buying a used Mac. Strictly speaking, they still haven't seen a single penny from me, unless the person I bought it from somehow decided to send them part of my purchase amount.
|
|
|
|
|
|
Yeah,
I think this is the best option. I was going to suggest the macOS Catalina virtual image... but then you wouldn't get any useful benchmarks if your trying to optimize code.
|
|
|
|
|
Ooooh just what i needed!
Real programmers use butterflies
|
|
|
|
|
wasn't there someone last week who got sued for having too good of an emulator?
To err is human to really elephant it up you need a computer
|
|
|
|
|
Amazon also offers cloud macs.
Amazon EC2 Mac Instances - Amazon Web Services[^]
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Why bother? Who uses an Apple device in these enlightened days?
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
I think with that new processor they have I'll see some using my library.
Besides, my library supports several exotic architectures. Even some 8-bit ones, and while it will compile and run on Apple right now (*knock on wood*) i can make it 5x to 6x faster by implementing two almost trivial functions.
Real programmers use butterflies
|
|
|
|