search for: compactpoint

Displaying 2 results from an estimated 2 matches for "compactpoint".

Did you mean: compactpointer
2014 Dec 05
6
[LLVMdev] instruction/intrinsic for segmented adressing
Hi, would like to use LLVM as backend for a compiler. One of the features I would like to implement is segment based addressing for position independent data. For some it may sound strange, for others the opposite. No need to write complex story. Imagine you have a custom alocator that manages an area of 1GB of memory. Your application uses a custom allocator to allocate memory inside this area,
2014 Dec 06
2
[LLVMdev] instruction/intrinsic for segmented adressing
...t is possible in a LLVM pass to track back all pointers in the IR that were initialized with a certain function (factory function) and change the addressing Tried to play with a naiv approach. uint8_t *global_segment; #define ainline __attribute__((always_inline)) template<class A> class CompactPointer { uint32_t adr; public: ainline A *operator->() { return reinterpret_cast<A*>(static_cast<uint32_t*>(global_segment)+adr);} }; int main() { CompactPointer<OtherObject> cpoo; CompactPointer<Object> cp = cpoo->cpo; } ~ all such derefer...