c++ - internal working of placement new? -
in 1 interview asked that
suppose have 25 mb of memory , have 3 processes of 10 mb each. how assure process should not run out of memory ?
i replied if use placement new
survive. asked me how relate placement new
realloc
?
i want know placement new
related realloc
?
realloc
isn't valid placement new. since memory might end in new location, pointers referring object become invalidated, pointers contained within objects themselves. think of linked list example.
the interviewer looking mention of virtual memory.
Comments
Post a Comment