The Android ION memory allocator
The Android ION memory allocator
Posted Jul 5, 2016 13:24 UTC (Tue) by excors (subscriber, #95769)In reply to: The Android ION memory allocator by simonwan
Parent article: The Android ION memory allocator
Error -19 is -ENODEV, and I think ion_alloc can only return that if there are no heaps that match the heap_id_mask in your allocation request, so you should check you're setting that correctly. /sys/kernel/debug/ion/heaps/ should list the heaps available on your device (though you probably need to read the kernel headers to find the enum definitions for them).
Also check that you're calling the right version of the kernel API - lots of details have changed since this article was written (e.g. the heap mask is now a separate field in ion_allocation_data, not part of flags), so you should use libion or read the kernel source from your particular device.