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

  • SEARCH
  • Home
  • 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 3690760
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:04:17+00:00 2026-05-19T04:04:17+00:00

Ultimately I am just trying to figure out how to dynamically allocate heap memory

  • 0

Ultimately I am just trying to figure out how to dynamically allocate heap memory from within assembly.

If I call Linux sbrk() from assembly code, can I use the address returned as I would use an address of a statically (ie in the .data section of my program listing) declared chunk of memory?

I know Linux uses the hardware MMU if present, so I am not sure if what sbrk returns is a ‘raw’ pointer to real RAM, or is it a cooked pointer to RAM that may be modified by Linux’s VM system?

I read this: How are sbrk/brk implemented in Linux?. I suspect I can not use the return value from sbrk() without worry: the MMU fault on access-non-allocated-address must cause the VM to alter the real location in RAM being addressed. Thus assy, not linked against libc or what-have-you, would not know the address has changed.

Does this make sense, or am I out to lunch?

  • 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-19T04:04:18+00:00Added an answer on May 19, 2026 at 4:04 am

    Unix user processes live in virtual memory, no matter if written in assembler of Fortran, and should not care about physical addresses. That’s kernel’s business – kernel sets up and manages the MMU. You don’t have to worry about it. Page faults are handled automatically and transparently.

    sbrk(2) returns a virtual address specific to the process, if that’s what you were asking.

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

Sidebar

Related Questions

I just spent too much time of my day trying to figure out some
Ultimately I'm trying to write out a range into a text file. When I
I'm trying to figure out syntax that supports unboxing an integral type (short/int/long) to
for the last hour I have been trying to figure this out myself but
I'm trying to figure out how to design my model. I've been going over
I'm having a really hard time trying to figure out how to store or
I'm trying to figure out how to manually trigger events for Leaflet polygons (loaded
I'm trying to figure out a way to store metadata about a column without
so I am completely new to jquery and am trying to figure out how
Ultimately I am trying to run some code which depends on the value (or

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.