Removing old GetObject.

This commit is contained in:
Ben Vanik 2015-05-24 21:38:49 -07:00
parent a2b66f9109
commit 814ec82ad4
2 changed files with 0 additions and 38 deletions

View File

@ -151,42 +151,6 @@ X_STATUS ObjectTable::RemoveHandle(X_HANDLE handle) {
return result;
}
X_STATUS ObjectTable::GetObject(X_HANDLE handle, XObject** out_object,
bool already_locked) {
handle = TranslateHandle(handle);
if (!handle) {
return X_STATUS_INVALID_HANDLE;
}
XObject* object = nullptr;
if (!already_locked) {
table_mutex_.lock();
}
// Lower 2 bits are ignored.
uint32_t slot = handle >> 2;
// Verify slot.
if (slot < table_capacity_) {
ObjectTableEntry& entry = table_[slot];
if (entry.object) {
object = entry.object;
}
}
// Retain the object pointer.
if (object) {
object->Retain();
}
if (!already_locked) {
table_mutex_.unlock();
}
*out_object = object;
return object ? X_STATUS_SUCCESS : X_STATUS_INVALID_HANDLE;
}
XObject* ObjectTable::LookupObject(X_HANDLE handle, bool already_locked) {
handle = TranslateHandle(handle);
if (!handle) {

View File

@ -28,8 +28,6 @@ class ObjectTable {
X_STATUS AddHandle(XObject* object, X_HANDLE* out_handle);
X_STATUS RemoveHandle(X_HANDLE handle);
X_STATUS GetObject(X_HANDLE handle, XObject** out_object,
bool already_locked = false);
template <typename T>
object_ref<T> LookupObject(X_HANDLE handle) {
auto object = LookupObject(handle, false);