Jump to content

Hello, im looking for materials to learn about intentional overlap. Where you pass arguements to a function, but leave them at the top and have intentional memory overlap so that you dont have to copy the arguements.

 

C++ is what i prefer.

 

Edit: i heard about them doing this for a vm in android phones.

Link to comment
https://linustechtips.com/topic/1006850-intentional-overlap/
Share on other sites

Link to post
Share on other sites

By "top" do you mean like top of the memory stack?

 

In C++ there are references, pointers, move semantics, initializer lists, copy constructors, all of which are about avoiding unnecessary copies in memory, and you can kind of think of it like "overlapping memory" I guess.

But i'm a bit confused, since as far as i'm aware, most android development is done in Java and that doesn't have anything like these features since it abstracts all memory away from the high level code construction.

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
https://linustechtips.com/topic/1006850-intentional-overlap/#findComment-12068098
Share on other sites

Link to post
Share on other sites

4 hours ago, fpo said:

 

Im looking for an example of how it works on a virtual stack machine. They had a specific way for an android vm that was super efficient!

 

some guy mentioned it at a university of San Francisco lecture but didnt go over much.

Link to comment
https://linustechtips.com/topic/1006850-intentional-overlap/#findComment-12069632
Share on other sites

Link to post
Share on other sites

17 minutes ago, Kamjam66xx said:

Im looking for an example of how it works on a virtual stack machine. They had a specific way for an android vm that was super efficient!

 

some guy mentioned it at a university of San Francisco lecture but didnt go over much.

You're gonna need to be more specific (at least for me, maybe someone else has a better idea of what you're asking). If you're talking about how "managing memory in a virtual stack machine" works, that's like asking "How does the JVM handle memory".

 

I can tell you how C++ the language handles memory, but I can't hypothesize how an unknown virtual stack machine built for android might manage memory to avoid duplicates. I need some more specificity in the question. 

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
https://linustechtips.com/topic/1006850-intentional-overlap/#findComment-12069675
Share on other sites

Link to post
Share on other sites

16 hours ago, Kamjam66xx said:

Hello, im looking for materials to learn about intentional overlap. Where you pass arguements to a function, but leave them at the top and have intentional memory overlap so that you dont have to copy the arguements.

 

C++ is what i prefer.

 

Edit: i heard about them doing this for a vm in android phones.

What's wrong with using pointers?

Link to comment
https://linustechtips.com/topic/1006850-intentional-overlap/#findComment-12069737
Share on other sites

Link to post
Share on other sites

18 minutes ago, Kamjam66xx said:

Oops my bad, i was going off memory and remembered it totally wrong. Any info on that would be awesome too. Sorry. It didnt make sense in my head which is why i asked, and now it does.

What they're talking about sounds like an optimization for process virtual machines like JVM and Dalvik. In actual hardware, a function call would typically push the current state of the registers onto a stack, so the function that was called is given a fresh processor state. In other words, you can't overlap memory like how they described in the video using the processor's registers, because those values were shuffled off somewhere else already.

Link to comment
https://linustechtips.com/topic/1006850-intentional-overlap/#findComment-12069884
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×