c++ - Create Array Beginning at Specific Address -
c++ - Create Array Beginning at Specific Address -
in c++, possible create array of specific size (such short array[2048]) begins @ specific address, such 0x1000?
short answer: no. in non-embedded systems (for i'll limit reply to) user address space virtual address space. meaning if pointer points 0x1000 not physical location of allocated info in physical memory map. so, since scheme hides physical addresses - can't request specific physical address. virtual addresses however, adiffernet story...
having understood there no guarantee pointing 0x1000 mean pointing physical address 0x1000, in linux can utilize function mmap()
, windows counterpart virtualalloc()
request allocation specific virtual address. of course of study these functions not guaranteed work (for instance, if virtual address requesting mapped or if scheme "reserved").
c++ arrays memory
Comments
Post a Comment