1 /* 2 * Copyright 2013, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "ReturnValueInfo.h" 8 9 #include "CpuState.h" 10 11 12 ReturnValueInfo::ReturnValueInfo() 13 : 14 BReferenceable(), 15 fAddress(0), 16 fState(NULL) 17 { 18 } 19 20 21 ReturnValueInfo::ReturnValueInfo(target_addr_t address, CpuState* state) 22 : 23 BReferenceable(), 24 fAddress(address), 25 fState(state) 26 { 27 state->AcquireReference(); 28 } 29 30 31 ReturnValueInfo::~ReturnValueInfo() 32 { 33 if (fState != NULL) 34 fState->ReleaseReference(); 35 } 36 37 38 void 39 ReturnValueInfo::SetTo(target_addr_t address, CpuState* state) 40 { 41 fAddress = address; 42 43 if (fState != NULL) 44 fState->ReleaseReference(); 45 46 fState = state; 47 fState->AcquireReference(); 48 } 49