Something went wrong. Try again.
Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#include "LoadableObject.h"#include <libmach-o/MachO.h>#include "MachOObject.h"#include "NativeObject.h"#include "dl_public.h"#include "arch.h"
namespace Darling { LoadableObject::LoadableObject(){ m_refs = 1;}
int LoadableObject::addRef(){ return ++m_refs;}
int LoadableObject::delRef(){ int refs = --m_refs; if (!refs && !m_noDelete) { if (isLoaded()) unload(); delete this; } return refs;}
LoadableObject* LoadableObject::instantiateForPath(const std::string& path, MachOObject* requester, int flag){ if (MachO::isMachO(path.c_str())) { MachOObject* obj = new MachOObject(path); obj->setRequesterRunpaths(requester); obj->setNoRecursion(flag & DARWIN_RTLD_FIRST); return obj; } else { return new NativeObject(path); }}
void LoadableObject::transitionState(dyld_image_states newState){ m_state = newState;}
} // namespace Darling