News for hackers. Stuff that matters.
Re:Apple’s use of Swift in iOS 12 by RyanZAG on Friday September 28, 2018 @01:11AM (#18091237)
If an app (even badly coded) causes memory leaks in the OS, that's a fault of the OS still. Of course fast moving OSes like Android or iOS are always going to have these kinds of bugs and it's probably not related to Swift as Swift isn't used in the kernel internals.
Re:Apple’s use of Swift in iOS 12 by coldtea on Friday September 28, 2018 @01:45AM (#18091321)
>If an app (even badly coded) causes memory leaks in the OS, that's a fault of the OS still.

How's that so? An app doesn't have to leak OS memory, just leak its own memory.

Re:Apple’s use of Swift in iOS 12 by saagarjha on Friday September 28, 2018 @02:30AM (#18091436)
Well, leaking kernel memory is very different than leaking application memory, because one can be paged out while the other is wired permanently.
Re:Apple’s use of Swift in iOS 12 by vbezhenar on Friday September 28, 2018 @03:26AM (#18091613)
iOS does not swap.
Re:Apple’s use of Swift in iOS 12 by saagarjha on Friday September 28, 2018 @04:09AM (#18091742)
It will page out clean pages as necessary, though.
Re:Apple’s use of Swift in iOS 12 by vardump on Friday September 28, 2018 @03:20AM (#18091594)
Wired? All memory is always physically wired to the motherboard.

It's unsafe for the kernel to swap the memory out, because paging doesn't (usually) work while running kernel code.

Re:Apple’s use of Swift in iOS 12 by saagarjha on Friday September 28, 2018 @04:10AM (#18091745)
Wired as in not swappable.
Re:Apple’s use of Swift in iOS 12 by vardump on Friday September 28, 2018 @05:09AM (#18091971)
I write kernel mode drivers as my day job, and this is certainly the first time I've ever heard of non-swappable being called "wired".

It might be called "non-pageable", "pinned", "non-swappable", etc. Out of those, I'd prefer "non-pageable", because it's the most descriptive term for it.

Non-standard terminology is not great for communication.

Re:Apple’s use of Swift in iOS 12 by gaius on Friday September 28, 2018 @06:01AM (#18092172)
I write kernel mode drivers as my day job, and this is certainly the first time I've ever heard of non-swappable being called "wired".

For what OS? Consider https://wiki.freebsd.org/Memory

Wired

    - Non-pageable memory: cannot be freed until explicitly released by the owner
    - Userland memory can be wired by mlock(2) (subject to system and per-user limits)
    - Kernel memory allocators return wired memory
    - Contents of the ARC and the buffer cache are wired
    - Some memory is permanently wired and is never freed (e.g., the kernel file itself)

OSX is derived from BSD.
Re:Apple’s use of Swift in iOS 12 by vardump on Friday September 28, 2018 @06:03AM (#18092176)
> For what OS?

Check my other reply above. Did some FreeBSD work ~15 years ago, but I guess I'd already forgotten.

Re:Apple’s use of Swift in iOS 12 by Aaargh20318 on Friday September 28, 2018 @05:43AM (#18092111)
> I write kernel mode drivers as my day job, and this is certainly the first time I've ever heard of non-swappable being called "wired".

Really ? Because it's literally called that in macOS Activity Monitor app, the term is also used in Apple's kernel documentation and API's (e.g. in the `mem_and_io_snapshot` struct defined in 'debug.h' in Kernel.framework). It's also mentioned in the Kernel Programming Guide.

Re:Apple’s use of Swift in iOS 12 by vardump on Friday September 28, 2018 @05:55AM (#18092151)
Interesting.

Never did macOS drivers, just bare metal, Windows and Linux so far, macOS is not very big in our niche. Weird that Apple's terminology is so different.

Typing this on a Macbook Pro, and I can see that Activity Monitor does mention "wired" memory.

Re:Apple’s use of Swift in iOS 12 by Aaargh20318 on Friday September 28, 2018 @06:47AM (#18092352)
I did a little googling and I see the terminology is also used in the Mach microkernel, which macOS's XNU kernel was built upon. It looks like it's not something Apple came up with.
Re:Apple’s use of Swift in iOS 12 by module0000 on Friday September 28, 2018 @02:42PM (#18095894)
It's a MacOS thing. "Wired" confused me also initially. All it means is pages marked as "Wired" can't be offloaded to swap.