aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Speed up ScopedPrimitiveArrayROMathieu Chartier2015-09-111-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For small arrays <= 1024 elements, we use GetArrayRegion with stack allocated backing storage instead of GetArrayElements. The speedup comes from the fact that GetArrayRegion doesn't need to allocate a copy of array. Timing results for: https://android-review.googlesource.com/#/c/169727/ BEFORE Host: Byte length=1 ns/op=452.2633712 Short length=1 ns/op=468.6469192 Int length=1 ns/op=422.5663486 Long length=1 ns/op=423.4946638 Byte length=8 ns/op=424.8546962 Short length=8 ns/op=424.3842626 Int length=8 ns/op=424.3816324 Long length=8 ns/op=452.9407552 Byte length=64 ns/op=441.674149 Short length=64 ns/op=472.2310028 Int length=64 ns/op=455.6142958 Long length=64 ns/op=487.6810328 Byte length=512 ns/op=454.0858634 Short length=512 ns/op=497.675829 Int length=512 ns/op=481.2103832 Long length=512 ns/op=507.4674306 Byte length=4096 ns/op=531.7923602 Short length=4096 ns/op=648.254466 Int length=4096 ns/op=578.0794842 Long length=4096 ns/op=563.3641424 N5: Byte length=1 ns/op=3118.2292802 Short length=1 ns/op=3083.7797488 Int length=1 ns/op=3177.8996446 Long length=1 ns/op=3151.0892072 Byte length=8 ns/op=3287.7326966 Short length=8 ns/op=3126.5799676 Int length=8 ns/op=3197.3203112 Long length=8 ns/op=3201.0613218 Byte length=64 ns/op=3178.7730612 Short length=64 ns/op=3162.2255092 Int length=64 ns/op=3241.3191864 Long length=64 ns/op=3117.6674886 Byte length=512 ns/op=3106.540978 Short length=512 ns/op=3183.0501344 Int length=512 ns/op=3513.8142382 Long length=512 ns/op=3592.4372798 Byte length=4096 ns/op=3552.9428216 Short length=4096 ns/op=3997.586686 Int length=4096 ns/op=4545.2151442 Long length=4096 ns/op=4371.4996338 AFTER Host: Byte length=1 ns/op=261.764995 Short length=1 ns/op=238.6584262 Int length=1 ns/op=262.856902 Long length=1 ns/op=238.0286378 Byte length=8 ns/op=242.4962264 Short length=8 ns/op=247.8668746 Int length=8 ns/op=263.9420024 Long length=8 ns/op=243.3675294 Byte length=64 ns/op=243.3372902 Short length=64 ns/op=249.0408034 Int length=64 ns/op=250.2168296 Long length=64 ns/op=253.837053 Byte length=512 ns/op=252.8071526 Short length=512 ns/op=271.689653 Int length=512 ns/op=291.8933238 Long length=512 ns/op=341.6303746 Byte length=4096 ns/op=540.8749038 Short length=4096 ns/op=661.7068158 Int length=4096 ns/op=569.030217 Long length=4096 ns/op=565.0571702 N5: Byte length=1 ns/op=1209.4042078 Short length=1 ns/op=1207.2498746 Int length=1 ns/op=1377.0557706 Long length=1 ns/op=1348.6359368 Byte length=8 ns/op=1260.0724162 Short length=8 ns/op=1229.6107912 Int length=8 ns/op=1414.1408952 Long length=8 ns/op=1394.1158746 Byte length=64 ns/op=1232.532947 Short length=64 ns/op=1228.1248122 Int length=64 ns/op=1468.2667912 Long length=64 ns/op=1404.232687 Byte length=512 ns/op=1256.976093 Short length=512 ns/op=1335.5540308 Int length=512 ns/op=1599.6927076 Long length=512 ns/op=1769.8866764 Byte length=4096 ns/op=3310.2486656 Short length=4096 ns/op=3956.6322484 Int length=4096 ns/op=4374.6221234 Long length=4096 ns/op=4256.71598 Bug: 19664826 Change-Id: I703d7346de732199be1feadbead021c6647a554a
* Replace InetUnixAddress with UnixSocketAddressNeil Fuller2015-07-071-1/+1
| | | | | | | UnixSocketAddress maps to stuct sockaddr_un from sys/un.h. Bug: 3106438 Change-Id: Ia4d57729e286c8b3a62a78202bc2385f0d33cb52
* ScopedFd: Don't use TEMP_FAILURE_RETRY() with close()Spencer Low2015-05-131-2/+5
| | | | | | | | | | | According to the comments in Posix_close(), TEMP_FAILURE_RETRY() should not be used with close(): https://android.googlesource.com/platform/libcore/+/462bdac45c10f43d88d8f07f6994e272a27c14a2%5E%21/#F12 Bug: http://b/20501816 Change-Id: Ie283f848c4fe50fcde9358c8ed307ec048e70892 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
* Add JNI references for PacketSocketAddress.Lorenzo Colitti2015-03-121-5/+5
| | | | | | Also remove an outdated comment. Change-Id: If0da380f78c1e77963953d8e64737d0f22c90fad
* Add JNI references for android.system.NetlinkSocketAddress.Erik Kline2015-02-251-0/+1
| | | | | | | | Developed in conjunction with: https://android-review.googlesource.com/135491 Bug: 18581716 Change-Id: Icddee915579e4187a181138f8ef8d92f3a70de35
* Rename field: fd -> fd_Dmitriy Ivanov2015-01-201-8/+8
| | | | | | This is fix avoid shadow variable warning Change-Id: I014ab622b33326470b89e3971b7ad898700f9962
* Add Class<java.util.zip.ZipEntry> to JniConstants.Narayan Kamath2015-01-081-0/+1
| | | | | | For use in StrictJarFile. Change-Id: Ife29e359cd97cf71b184151ebb0efffaa9cdb0a8
* Don't need swap anymore.Dan Albert2014-11-051-10/+0
| | | | | | | | | | | The declaration of std::swap here is inconsistent with the one in libc++ (noexcept differences). Rather than worrying about keeping them all consistent, just remove swap. It was only ever added for ART, and ART now uses std::unique_ptr instead. This was causing an ambiguous overload error in system/core. Change-Id: I4cf4c41c5dda01a96915e8309af2f8be089d1a2a
* Add DISALLOW_COPY_AND_ASSIGN macro.Ian Rogers2014-11-049-38/+36
| | | | | | | | Make the DISALLOW_COPY_AND_ASSIGN macro delete the member functions rather than just not defining them to improve analysis of the Scoped.. classes. Add a few missing const qualifiers. Change-Id: I48eee0c22908d45a05df6979aa61442d2eedcf36
* NativeHelper: Avoid returning local stack stringNingsheng Jian2014-09-291-2/+5
| | | | | | | | Refactor JniInvocation::GetLibrary to not return a stack-allocated string. Instead, provide a char buffer. Bug: 16404669 Change-Id: I34f4a40e28bc491ba630a2b1bff5792e34937101
* NativeHelper: Do not allow arbitrary library strings in user buildsAndreas Gampe2014-08-251-0/+3
| | | | | | | | | | On device, only allow "libart.so" in non-debuggable (user) builds. Bug: 16404669 (cherry picked from commit 5019faa3a6bdde33785ece0537e8b865ea7cf938) Change-Id: Ie163c04ce40c82698dcc98ced651dafef094d8b5
* Add reset to ScopedFd.Ian Rogers2014-06-211-3/+8
| | | | | | The implementation follows the pattern of UniquePtr. Change-Id: I761c89d393b610600e863e223f2545ded1fde441
* TEMP_FAILURE_RETRY() requires errno.hDan Albert2014-05-211-0/+1
| | | | | | | Fixes compiler error about not finding errno when art is compiled for the host using libc++. Change-Id: Ib2bcd6b230dbb05e7c5306d5d12e25483202b457
* Make libnativehelper C++ library agnostic and remove libnativehelper_libc++.Ian Rogers2014-05-161-1/+21
| | | | Change-Id: Ib5510add3337992dc2a99affe671a01d39782237
* Changes to add libcore.io.StructGroupSourceReqNeil Fuller2014-02-061-0/+1
| | | | | | | | | This change is related to https://android-review.googlesource.com/#/c/81324/ - both must be merged at the same time to avoid a build break. Change-Id: Id7cc97a368c7eca5901c3d0fa45d2b4962f99ac1
* Merge commit 'd53ee92b5ce950d0c39dc9963cca5b80c400d03f' into HEADThe Android Open Source Project2013-11-222-14/+63
|\
| * am a77f3a24: Add support for ndk libnativehelper build.Ruben Brunk2013-09-111-14/+0
| |\ | | | | | | | | | | | | * commit 'a77f3a243aad5632832fa822e1ac07bb4b5d5668': Add support for ndk libnativehelper build.
| | * Add support for ndk libnativehelper build.android-cts-4.4_r1android-4.4_r1.0.1android-4.4_r1android-4.4_r0.9android-4.4_r0.8android-4.4_r0.7kitkat-cts-devRuben Brunk2013-09-101-14/+0
| | | | | | | | | | | | | | | | | | Bug: 10680559 Change-Id: I18491baac6acc4486f2e87175c922b40b5c17179
| * | am 61b8cd95: Merge "Remove direct dependence on stlport"Kenny Root2013-09-111-1/+5
| |\ \ | | | | | | | | | | | | | | | | * commit '61b8cd95dcd8e4ebda7df65e9fb1d8512c7baa7a': Remove direct dependence on stlport
| * \ \ am e0f789dc: Merge "Remove dead code: jniGetStackTrace."Elliott Hughes2013-09-031-16/+0
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * commit 'e0f789dcfc4ff18127fa00a6f99c5236c2e27eed': Remove dead code: jniGetStackTrace.
| * \ \ \ am e1ade693: Merge "Remove toStringArray16, which is now unused."Elliott Hughes2013-08-261-22/+0
| |\ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | * commit 'e1ade6936a9e883205f1dc3362effcd19a057723': Remove toStringArray16, which is now unused.
| * | | | am dc8d2bcf: am 416fa5b7: Merge "Switch libnativehelper from statfs to statvfs."Elliott Hughes2013-07-111-1/+1
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * commit 'dc8d2bcfe4f3464e88c4dd9a02f39af9b4519fcf': Switch libnativehelper from statfs to statvfs.
| * | | | | Renaming dalvik.vm.lib to persist.sys.dalvik.vm.libBrian Carlstrom2013-07-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I120e2f85a5f946d5884cca722b3bdc61961eb32b
| * | | | | Add JNI Invocation API to libnativehelperBrian Carlstrom2013-06-201-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I15870937ad7bfa4757e21f83acbbb6a7826a0b0b
* | | | | | Add ScopedFd.release() and TEMP_FAILURE_RETRY the close().Vladimir Marko2013-11-071-1/+10
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, check for fd being -1 in destructor. There's no need to set errno to EBADF after release() or if an open() call used to initialize a ScopedFd failed. Change-Id: I97c6c7db797a20c6850a36c61fe5b369547c4002
* | | | | Remove direct dependence on stlportKenny Root2013-09-111-1/+5
| |_|_|/ |/| | | | | | | | | | | Change-Id: I17caa47ff8b4a38d7015ac0509789c5475f23e21
* | | | Remove dead code: jniGetStackTrace.Elliott Hughes2013-09-031-16/+0
| |_|/ |/| | | | | | | | Change-Id: I841da6eef183ddf13a9c058c204f4f244a389eb3
* | | Remove toStringArray16, which is now unused.Elliott Hughes2013-08-261-22/+0
| |/ |/| | | | | | | Bug: 10492721 Change-Id: I2c1dcc48d1cba20e9abc163d88effac144a1de34
* | am 416fa5b7: Merge "Switch libnativehelper from statfs to statvfs."Elliott Hughes2013-07-091-1/+1
|\ \ | |/ |/| | | | | * commit '416fa5b75151d8a5506d764c3d20e713bdb3fe88': Switch libnativehelper from statfs to statvfs.
| * Switch libnativehelper from statfs to statvfs.Elliott Hughes2013-07-091-1/+1
| | | | | | | | Change-Id: I7b3aa8fedc1749d4428ad0df792b6fb8c00030b6
* | am cf5ac0ec: Merge "Scoped primitive arrays: allow them to be null"Kenny Root2013-05-201-0/+12
|\| | | | | | | | | * commit 'cf5ac0ec696fce7fac6b324ec7d4d6da217e501c': Scoped primitive arrays: allow them to be null
| * Scoped primitive arrays: allow them to be nullKenny Root2013-05-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | Sometimes there is a pattern where you may have an optional argument to a JNI call. Instead of throwing NullPointerException which would be done on required arguments, let the programmer create the scoped array and reset it to the value if it's determined later that the argument was provided. This eliminates the need to handle raw primitive array objects and the chance that they will accidentally leaked. Change-Id: Ic701b33e710b292ff9a63e75c7b763f4ce71e011
* | am 89544997: Merge "Move ScopedFd from libcore to libnativehelper (part 1)"Brian Carlstrom2013-05-141-0/+46
|\| | | | | | | | | * commit '89544997f88c808a03865ac7b3eac217f6cf036f': Move ScopedFd from libcore to libnativehelper (part 1)
| * Move ScopedFd from libcore to libnativehelper (part 1)Brian Carlstrom2013-05-141-0/+46
| | | | | | | | Change-Id: I01941409001107ff1825a56919cdbea6fa017fa5
* | am 442a079e: Merge "Add swap operation to UniquePtr."Brian Carlstrom2013-05-101-0/+6
|\| | | | | | | | | * commit '442a079ec17770e6b0fa912b0c1e26c2dc64af8a': Add swap operation to UniquePtr.
| * Add swap operation to UniquePtr.Mathieu Chartier2013-05-101-0/+6
| | | | | | | | | | | | | | | | | | Enables swapping without mPtr ever becoming null. Required by https://googleplex-android-review.googlesource.com/#/c/250540/ (cherry picked from commit be7922da0cf9b759f01f09b5f259e083f8d1f0b8) Change-Id: I06ec54e174d251cd2938efba8e628d0eaf6ebcc5
* | am 95779265: Merge "Move more utility classes from libcore to ↵Brian Carlstrom2013-05-107-0/+669
|\| | | | | | | | | | | | | libnativehelper (part 1)" * commit '9577926537ea6668ec4ade67d5758f871e9e5fb3': Move more utility classes from libcore to libnativehelper (part 1)
| * Move more utility classes from libcore to libnativehelper (part 1)Brian Carlstrom2013-05-107-0/+669
| | | | | | | | Change-Id: If51679ea9d97ed405d07fb7ccf26489f59ef208d
* | Move jniGetReferent to use JniConstantsJeff Brown2013-05-101-0/+1
| | | | | | | | Change-Id: Ia99480728245c770169d388f63fae6bcde6ba2cc
* | resolved conflicts for merge of b50e3d9d to jb-mr2-dev-plus-aospBrian Carlstrom2013-05-103-0/+190
|\| | | | | | | Change-Id: If420d6dd7d80810d6768789f3f5ea362c8f11afc
| * Manually merge JniConstants changes from 81fd7cc0.Elliott Hughes2013-05-091-0/+2
| | | | | | | | | | | | (cherry picked from commit 40f73e04d8c37b456224908ad7b57210cba933c2) Change-Id: I34de4bafbe648a7f3c467028c887c418402c7917
| * Add Calendar, Object, Object[] to well-known listKenny Root2013-05-091-0/+3
| | | | | | | | | | | | | | | | Needed for libcore change 75dc9601af8ab3c65114e3c8c57d29ce5ac64125 (cherry picked from commit 5cfc839e8c72a271745245dcebaeccdbfc069153) Change-Id: Ie2b4593d97c3815af38c12a35e12cb216aa91887
| * Add InputStream and OutputStream to the well-known classes.Elliott Hughes2013-05-091-0/+2
| | | | | | | | | | | | | | | | Needed for libcore change f6abc2f4fc2000a34b2ef86eccb83d37c22ef35f. (cherry picked from commit 9bd4783be0af6ebd8f72e055e72fe40b63af1cda) Change-Id: I4b84a9e110a6f504694ac8f6e682ebdd238ff8ba
| * Fix build. JniConstants is in libnativehelper, not libcore, in dalvik-dev.Elliott Hughes2013-05-091-1/+0
| | | | | | | | | | | | (cherry picked from commit fbdbc836061672d6ea8145ba01e7f3149fb417ce) Change-Id: I664b55d3f259be5ee8a83de42b4fb021eeb65775
| * Moving libnativehelper additions from libcoreBrian Carlstrom2013-05-093-0/+184
| | | | | | | | | | | | (cherry picked from commit b66098568f22d672aac3949a39e92d8a474e4b94) Change-Id: I60381a253af8ee738b1dac8ec124bf13aa7f5f82
* | Add a helper to get the referent of a Reference.android-4.3_r3.1android-4.3_r3android-4.3_r2.3android-4.3_r2.2android-4.3_r2.1android-4.3_r2android-4.3_r1.1android-4.3_r1android-4.3_r0.9.1android-4.3_r0.9android-4.3.1_r1jb-mr2.0.0-releasejb-mr2.0-releasejb-mr2-releasejb-mr2-devJeff Brown2013-04-021-0/+9
|/ | | | Change-Id: I8ac5a69fab563e220d48c94e254f5ed3055abe5f
* Use <stdint.h> in jni.h for better x86_64 portability.Elliott Hughes2013-02-271-25/+12
| | | | | | Otherwise templates won't match jlong to long or int64_t. Change-Id: I805133d86f75691c6920bebf3d79f1ce47f0861c
* Make libnativehelper stand-alone.android-sdk-support_r11android-cts-4.2_r2android-cts-4.2_r1android-cts-4.1_r4android-cts-4.1_r2android-cts-4.1_r1android-4.2_r1android-4.2.2_r1.2android-4.2.2_r1.1android-4.2.2_r1android-4.2.1_r1.2android-4.2.1_r1.1android-4.2.1_r1android-4.1.2_r2.1android-4.1.2_r2android-4.1.2_r1android-4.1.1_r6.1android-4.1.1_r6android-4.1.1_r5android-4.1.1_r4android-4.1.1_r3android-4.1.1_r2android-4.1.1_r1.1android-4.1.1_r1tools_r21jb-releasejb-mr1.1-releasejb-mr1.1-devjb-mr1-releasejb-mr1-devjb-mr0-releasejb-devElliott Hughes2012-05-031-1/+2
| | | | | Bug: 6369821 Change-Id: I502211bddaf60d6097b81b35f606bbcdd1a3e092
* Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGESteve Block2011-10-251-1/+1
| | | | | | | See https://android-git.corp.google.com/g/#/c/141576 Bug: 5449033 Change-Id: Ie3bc0d5436218ea05f98cb0373ecf5924f78db05
* Fix JNIEXPORT now people are using -fvisibility.Elliott Hughes2011-08-191-7/+6
| | | | | | This is a backport from dalvik-dev. Change-Id: If6001b580bd9b36f3845aaa115333d69682f3a92