本文整理汇总了C++中RETURN_PTR函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_PTR函数的具体用法?C++ RETURN_PTR怎么用?C++ RETURN_PTR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_PTR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DECLARE
DECLARE(char*, strtok, char *str, const char *delim)
{
BEGIN(strtok);
char *ret_ptr = REAL(strtok)(str, delim);
/* ret_ptr points to a private libc-side buffer. */
RETURN_PTR(ret_ptr, ret_ptr, (char*) ret_ptr + (ret_ptr ? strlen(ret_ptr) + 1 : 1));
}
示例2: fastiva_Dalvik_dalvik_system_VMRuntime_properties
java_lang_String_ap fastiva_Dalvik_dalvik_system_VMRuntime_properties(dalvik_system_VMRuntime_p self) {
#endif
ArrayObject* result = dvmCreateStringArray(*gDvm.properties);
dvmReleaseTrackedAlloc((Object*) result, dvmThreadSelf());
RETURN_PTR((java_lang_String_ap)result);
}
示例3: fastiva_Dalvik_java_lang_System_mapLibraryName
java_lang_String_p fastiva_Dalvik_java_lang_System_mapLibraryName(java_lang_String_p nameObj) {
#endif
StringObject* result = NULL;
char* name;
char* mappedName;
if (nameObj == NULL) {
dvmThrowNullPointerException("userLibName == null");
THROW_V();
}
name = dvmCreateCstrFromString(nameObj);
#ifdef _DEBUG
assert(strstr(name, "cfb") == NULL);
#endif
mappedName = dvmCreateSystemLibraryName(name);
if (mappedName != NULL) {
result = dvmCreateStringFromCstr(mappedName);
dvmReleaseTrackedAlloc((Object*) result, NULL);
}
free(name);
free(mappedName);
RETURN_PTR((java_lang_String_p)result);
}
示例4: Dalvik_java_lang_reflect_Field_getField
/*
* private Object getField(Object o, Class declaringClass, Class type,
* int slot, boolean noAccessCheck)
*
* Primitive types need to be boxed.
*/
static void Dalvik_java_lang_reflect_Field_getField(const u4* args,
JValue* pResult)
{
// ignore thisPtr in args[0]
Object* obj = (Object*) args[1];
ClassObject* declaringClass = (ClassObject*) args[2];
ClassObject* fieldType = (ClassObject*) args[3];
int slot = args[4];
bool noAccessCheck = (args[5] != 0);
JValue value;
const JValue* fieldPtr;
DataObject* result;
//dvmDumpClass(obj->clazz, kDumpClassFullDetail);
/* get a pointer to the field's data; performs access checks */
fieldPtr = getFieldDataAddr(obj, declaringClass, slot, false,noAccessCheck);
if (fieldPtr == NULL)
RETURN_VOID();
/* copy 4 or 8 bytes out */
if (fieldType->primitiveType == PRIM_LONG ||
fieldType->primitiveType == PRIM_DOUBLE)
{
value.j = fieldPtr->j;
} else {
value.i = fieldPtr->i;
}
result = dvmWrapPrimitive(value, fieldType);
dvmReleaseTrackedAlloc((Object*) result, NULL);
RETURN_PTR(result);
}
示例5: Dalvik_java_lang_VMClassLoader_findLoadedClass
/*
* static Class findLoadedClass(ClassLoader cl, String name)
*/
static void Dalvik_java_lang_VMClassLoader_findLoadedClass(const u4* args,
JValue* pResult)
{
Object* loader = (Object*) args[0];
StringObject* nameObj = (StringObject*) args[1];
ClassObject* clazz = NULL;
char* name = NULL;
char* descriptor = NULL;
if (nameObj == NULL) {
dvmThrowException("Ljava/lang/NullPointerException;", NULL);
goto bail;
}
/*
* Get a UTF-8 copy of the string, and convert dots to slashes.
*/
name = dvmCreateCstrFromString(nameObj);
if (name == NULL)
goto bail;
descriptor = dvmDotToDescriptor(name);
if (descriptor == NULL)
goto bail;
clazz = dvmLookupClass(descriptor, loader, false);
LOGVV("look: %s ldr=%p --> %p\n", descriptor, loader, clazz);
bail:
free(name);
free(descriptor);
RETURN_PTR(clazz);
}
示例6: Dalvik_dalvik_system_VMRuntime_properties
static void Dalvik_dalvik_system_VMRuntime_properties(const u4* args,
JValue* pResult)
{
ArrayObject* result = dvmCreateStringArray(*gDvm.properties);
dvmReleaseTrackedAlloc((Object*) result, dvmThreadSelf());
RETURN_PTR(result);
}
示例7: Dalvik_dalvik_system_VMRuntime_newNonMovableArray
static void Dalvik_dalvik_system_VMRuntime_newNonMovableArray(const u4* args,
JValue* pResult)
{
ClassObject* elementClass = (ClassObject*) args[1];
int length = args[2];
if (elementClass == NULL) {
dvmThrowNullPointerException("elementClass == null");
RETURN_VOID();
}
if (length < 0) {
dvmThrowNegativeArraySizeException(length);
RETURN_VOID();
}
// TODO: right now, we don't have a copying collector, so there's no need
// to do anything special here, but we ought to pass the non-movability
// through to the allocator.
ClassObject* arrayClass = dvmFindArrayClassForElement(elementClass);
ArrayObject* newArray = dvmAllocArrayByClass(arrayClass,
length,
ALLOC_NON_MOVING);
if (newArray == NULL) {
assert(dvmCheckException(dvmThreadSelf()));
RETURN_VOID();
}
dvmReleaseTrackedAlloc((Object*) newArray, NULL);
RETURN_PTR(newArray);
}
示例8: fastiva_Dalvik_dalvik_system_VMRuntime_newNonMovableArray
java_lang_Object_p fastiva_Dalvik_dalvik_system_VMRuntime_newNonMovableArray(dalvik_system_VMRuntime_p self, java_lang_Class_p elementClass, jint length) {
#endif
if (elementClass == NULL) {
dvmThrowNullPointerException("elementClass == null");
THROW_V();
}
if (length < 0) {
dvmThrowNegativeArraySizeException(length);
THROW_V();
}
// TODO: right now, we don't have a copying collector, so there's no need
// to do anything special here, but we ought to pass the non-movability
// through to the allocator.
ClassObject* arrayClass = dvmFindArrayClassForElement(elementClass);
ArrayObject* newArray = dvmAllocArrayByClass(arrayClass,
length,
ALLOC_NON_MOVING);
if (newArray == NULL) {
assert(dvmCheckException(dvmThreadSelf()));
THROW_V();
}
dvmReleaseTrackedAlloc((Object*) newArray, NULL);
RETURN_PTR(newArray);
}
示例9: Dalvik_java_lang_VMThread_currentThread
/*
* static Thread currentThread()
*/
static void Dalvik_java_lang_VMThread_currentThread(const u4* args,
JValue* pResult)
{
UNUSED_PARAMETER(args);
RETURN_PTR(dvmThreadSelf()->threadObj);
}
示例10: Dalvik_java_lang_VMClassLoader_getBootClassPathResource
/*
* private static String getBootClassPathResource(String name, int index)
*
* Find a resource with a matching name in a boot class path entry.
*
* This mimics the previous VM interface, since we're sharing class libraries.
*/
static void Dalvik_java_lang_VMClassLoader_getBootClassPathResource(
const u4* args, JValue* pResult)
{
StringObject* nameObj = (StringObject*) args[0];
StringObject* result;
int idx = args[1];
char* name;
name = dvmCreateCstrFromString(nameObj);
if (name == NULL)
RETURN_PTR(NULL);
result = dvmGetBootPathResource(name, idx);
free(name);
dvmReleaseTrackedAlloc((Object*)result, NULL);
RETURN_PTR(result);
}
示例11: Dalvik_java_lang_String_intern
/*
* public String intern()
*
* Intern a string in the VM string table.
*/
static void Dalvik_java_lang_String_intern(const u4* args, JValue* pResult)
{
StringObject* str = (StringObject*) args[0];
StringObject* interned;
interned = dvmLookupInternedString(str);
RETURN_PTR(interned);
}
示例12: Dalvik_sun_misc_Unsafe_getObject
/*
* public native Object getObject(Object obj, long offset);
*/
static void Dalvik_sun_misc_Unsafe_getObject(const u4 *args, JValue *pResult) {
// We ignore the this pointer in args[0].
Object *obj = (Object *) args[1];
s8 offset = GET_ARG_LONG(args, 2);
Object **address = (Object **) (((u1 *) obj) + offset);
RETURN_PTR(*address);
}
示例13: Dalvik_java_lang_Object_internalClone
/*
* private Object internalClone()
*
* Implements most of Object.clone().
*/
static void Dalvik_java_lang_Object_internalClone(const u4* args,
JValue* pResult)
{
Object* thisPtr = (Object*) args[0];
Object* clone = dvmCloneObject(thisPtr);
dvmReleaseTrackedAlloc(clone, NULL);
RETURN_PTR(clone);
}
示例14: Dalvik_java_lang_reflect_AccessibleObject_getClassSignatureAnnotation
/*
* private static Object[] getClassSignatureAnnotation(Class clazz)
*
* Return the Signature annotation for the specified class. Equivalent to
* Class.getSignatureAnnotation(), but available to java.lang.reflect.
*/
static void Dalvik_java_lang_reflect_AccessibleObject_getClassSignatureAnnotation(
const u4* args, JValue* pResult)
{
ClassObject* clazz = (ClassObject*) args[0];
ArrayObject* arr = dvmGetClassSignatureAnnotation(clazz);
dvmReleaseTrackedAlloc((Object*) arr, NULL);
RETURN_PTR(arr);
}
示例15: Dalvik_org_apache_harmony_dalvik_ddmc_DdmVmInternal_getThreadStats
/*
* public static byte[] getThreadStats()
*
* Get a buffer full of thread info.
*/
static void Dalvik_org_apache_harmony_dalvik_ddmc_DdmVmInternal_getThreadStats(
const u4* args, JValue* pResult)
{
UNUSED_PARAMETER(args);
ArrayObject* result = dvmDdmGenerateThreadStats();
dvmReleaseTrackedAlloc((Object*) result, NULL);
RETURN_PTR(result);
}