diff --git a/runtime/src/main/cpp/Common.h b/runtime/src/main/cpp/Common.h new file mode 100644 index 00000000000..69bcead4f24 --- /dev/null +++ b/runtime/src/main/cpp/Common.h @@ -0,0 +1,6 @@ +#ifndef RUNTIME_COMMON_H +#define RUNTIME_COMMON_H + +#define RUNTIME_NOTHROW __attribute__((nothrow)) + +#endif // RUNTIME_COMMON_H diff --git a/runtime/src/main/cpp/Memory.h b/runtime/src/main/cpp/Memory.h index 9cb5a8f56d4..62d8abcb629 100644 --- a/runtime/src/main/cpp/Memory.h +++ b/runtime/src/main/cpp/Memory.h @@ -2,6 +2,7 @@ #define RUNTIME_MEMORY_H #include "Assert.h" +#include "Common.h" #include "TypeInfo.h" typedef enum { @@ -312,15 +313,6 @@ OBJ_GETTER(InitInstance, ObjHeader** location, const TypeInfo* type_info, PlacementHint hint, void (*ctor)(ObjHeader*)); -// Sets locally visible location. -void SetLocalRef(ObjHeader** location, const ObjHeader* object); -// Sets potentially globally visible location. -void SetGlobalRef(ObjHeader** location, const ObjHeader* object); -// Update locally visible location. -void UpdateLocalRef(ObjHeader** location, const ObjHeader* object); -// Update potentially globally visible location. -void UpdateGlobalRef(ObjHeader** location, const ObjHeader* object); - // // Object reference management. // @@ -344,16 +336,16 @@ void UpdateGlobalRef(ObjHeader** location, const ObjHeader* object); // // Sets locally visible location. -void SetLocalRef(ObjHeader** location, const ObjHeader* object); +void SetLocalRef(ObjHeader** location, const ObjHeader* object) RUNTIME_NOTHROW; // Sets potentially globally visible location. -void SetGlobalRef(ObjHeader** location, const ObjHeader* object); +void SetGlobalRef(ObjHeader** location, const ObjHeader* object) RUNTIME_NOTHROW; // Update locally visible location. -void UpdateLocalRef(ObjHeader** location, const ObjHeader* object); +void UpdateLocalRef(ObjHeader** location, const ObjHeader* object) RUNTIME_NOTHROW; // Update potentially globally visible location. -void UpdateGlobalRef(ObjHeader** location, const ObjHeader* object); +void UpdateGlobalRef(ObjHeader** location, const ObjHeader* object) RUNTIME_NOTHROW; // Optimization: release all references in range. -void ReleaseLocalRefs(ObjHeader** start, int count); -void ReleaseGlobalRefs(ObjHeader** start, int count); +void ReleaseLocalRefs(ObjHeader** start, int count) RUNTIME_NOTHROW; +void ReleaseGlobalRefs(ObjHeader** start, int count) RUNTIME_NOTHROW; #ifdef __cplusplus }