Change-Id: I6a3b11ac3b9d8a989a5752e3e6479071bc1be071
Signed-off-by: dahyeong.kim <dahyeong.kim@samsung.com>
#include <FBaseResult.h>
#include <FBaseSysLog.h>
#include <unique_ptr.h>
#include <FBaseResult.h>
#include <FBaseSysLog.h>
#include <unique_ptr.h>
-#include "FBase_String.h"
+#include "FBaseUtil_AtomicOperations.h"
#include "FBaseUtil_IcuConverter.h"
namespace Tizen { namespace Base
#include "FBaseUtil_IcuConverter.h"
namespace Tizen { namespace Base
{
if (*(value.__pRefCount) != UNSHAREABLE)
{
{
if (*(value.__pRefCount) != UNSHAREABLE)
{
- _String::AtomicInc(value.__pRefCount);
+ Utility::_AtomicOperations::AtomicInc(value.__pRefCount);
__pRefCount = value.__pRefCount;
__pValue = value.__pValue;
__capacity = value.__capacity;
__pRefCount = value.__pRefCount;
__pValue = value.__pValue;
__capacity = value.__capacity;
- _String::AtomicDec(__pRefCount);
+ Utility::_AtomicOperations::AtomicDec(__pRefCount);
SysTryReturnResult(NID_BASE, pRefCntTemp != null, E_OUT_OF_MEMORY, "Memory allocation failed");
wcsncpy(__pValue, pValue, __length);
SysTryReturnResult(NID_BASE, pRefCntTemp != null, E_OUT_OF_MEMORY, "Memory allocation failed");
wcsncpy(__pValue, pValue, __length);
- _String::AtomicDec(__pRefCount);
+ Utility::_AtomicOperations::AtomicDec(__pRefCount);
__pRefCount = pRefCntTemp.release();
}
__pRefCount = pRefCntTemp.release();
}
{
std::unique_ptr< int > pRefCntTemp(new (std::nothrow) int(1));
SysTryReturnResult(NID_BASE, pRefCntTemp != null, E_OUT_OF_MEMORY, "Memory allocation failed");
{
std::unique_ptr< int > pRefCntTemp(new (std::nothrow) int(1));
SysTryReturnResult(NID_BASE, pRefCntTemp != null, E_OUT_OF_MEMORY, "Memory allocation failed");
- _String::AtomicDec(__pRefCount);
+ Utility::_AtomicOperations::AtomicDec(__pRefCount);
__pRefCount = pRefCntTemp.release();
}
}
__pRefCount = pRefCntTemp.release();
}
}
std::unique_ptr< int > pRefCntTemp(new (std::nothrow) int(1));
SysTryReturn(NID_BASE, pRefCntTemp != null, false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed",
GetErrorMessage(E_OUT_OF_MEMORY));
std::unique_ptr< int > pRefCntTemp(new (std::nothrow) int(1));
SysTryReturn(NID_BASE, pRefCntTemp != null, false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed",
GetErrorMessage(E_OUT_OF_MEMORY));
- _String::AtomicDec(__pRefCount);
+ Utility::_AtomicOperations::AtomicDec(__pRefCount);
__pRefCount = pRefCntTemp.release();
}
}
__pRefCount = pRefCntTemp.release();
}
}
wcsncpy(__pValue, pValue, __length);
__pValue[__length] = '\0';
wcsncpy(__pValue, pValue, __length);
__pValue[__length] = '\0';
- _String::AtomicDec(__pRefCount);
+ Utility::_AtomicOperations::AtomicDec(__pRefCount);
__pRefCount = pRefCntTemp.release();
}
__pRefCount = pRefCntTemp.release();
}
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+// Copyright (c) 2013 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
+ * @file FBaseUtil_AtomicOperations.h
* @brief This is the header file for handling atomic operations.
*/
* @brief This is the header file for handling atomic operations.
*/
-#ifndef _FBASE_INTERNAL_STRING_H_
-#define _FBASE_INTERNAL_STRING_H_
+#ifndef _FBASE_UTIL_ATOMIC_OPERATIONS_H_
+#define _FBASE_UTIL_ATOMIC_OPERATIONS_H_
-namespace Tizen { namespace Base
+namespace Tizen { namespace Base { namespace Utility
+namespace _AtomicOperations
- * Atomically add the value to the variable that pRefCount points to.
+ * Atomically add the @c value to the variable that @c pRefCount points to.
+ * @since 2.1
+ * @remarks This method supposes 4 byte alignment in ARM architecture.
*/
inline int
AtomicAdd(volatile int* pRefCount, int value)
*/
inline int
AtomicAdd(volatile int* pRefCount, int value)
- * Atomically increase the variable that pRefCount points to by 1
+ * Atomically increase the variable that @c pRefCount points to by 1
+ * @since 2.1
+ * @remarks This method supposes 4 byte alignment in ARM architecture.
*/
inline int
AtomicInc(volatile int* pRefCount)
*/
inline int
AtomicInc(volatile int* pRefCount)
- * Atomically decrease the variable that pRefCount points to by 1
+ * Atomically decrease the variable that @c pRefCount points to by 1
+ * @since 2.1
+ * @remarks This method supposes 4 byte alignment in ARM architecture.
*/
inline int
AtomicDec(volatile int* pRefCount)
{
return AtomicAdd(pRefCount, -1);
}
*/
inline int
AtomicDec(volatile int* pRefCount)
{
return AtomicAdd(pRefCount, -1);
}
-} // _String
-}} // Tizen::Base
-#endif // _FBASE_INTERNAL_STRING_H_
\ No newline at end of file
+
+}}}} // Tizen::Base::Utility::_AtomicOperations
+#endif // _FBASE_UTIL_ATOMIC_OPERATIONS_H_