Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7565855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:15:50+00:00 2026-05-30T14:15:50+00:00

Is the final memory address of declared functions in any programming language (C++, C#,

  • 0

Is the final memory address of declared functions in any programming language (C++, C#, Java, C…) relative or absolute? (I am not asking the addressing mode of machine code language s relative or absolute)

(I would say it is relative but I need expert to comment it)
if it is relative, this means no matter where we call the function, the function will be copied and put into a stack based on program counter position. Therefore, two threads calling the same function at the same time, they will not affect with each other if they do not share the same variable.

if it is absolute, this means two threads call the same function, they will enter the same address!!(does it depend on static or non-static function) Besides, every time we create a class object, a certain size of each object may be used to store methods(functions). Then it will make the size of an object very large!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:15:52+00:00Added an answer on May 30, 2026 at 2:15 pm

    You are wrong.

    The virtual memory address of function in the main executable is absolute, the physical memory address can even change while the function is running (if the OS swaps out the process).

    For libraries, the virtual address may be absolute or relative. If it is relative, this is called “position-independent code”, and is useful if the library can’t load at its preferred address.

    Code is not placed on the stack. Local (automatic duration) variables usually are, which means separate copies for concurrent and recursive/re-entrant invocations. Since code is read-only, having multiple threads accessing the same address is no problem.

    JITted languages determine the address of each function at runtime, during conversion from intermediate language (such as Java bytecode) to machine code.

    Functions are not stored inside objects either. Oftentimes an object has a pointer to an array of pointers to functions, for polymorphism support (this is called virtual functions). These function pointers are accessed relative to the object, but the final code address is absolute (again, only the virtual address).

    And if the function gets inlined, then it may exist only as pieces mixed into other functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Java Memory Model (since 1.5) treats final fields differently to non- final fields.
on JLS 3, 17.5 Final Field Semantics's second discussion part: http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.5 It is said
I have a question regarding the Java Memory Model. Here is a simple class
I have a class on low-level programming which requires a final project (syllabus at
An example final question for my operating systems class: Most operating systems support memory-mapped
I am trying to create a memory game in Java. Something like this, but
I'm having problems with a slow memory leak in my mixed mode C++/CLR .NET
Final question for the night. And apologies for the complete noobness of this. I
Can final keyword be used for a method?
The final images produced by compliers contain both bin file and extended loader format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.