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 8845523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:45:42+00:00 2026-06-14T11:45:42+00:00

If I use allocate_aligned to allocate an aligned memory block within a chunk of

  • 0

If I use allocate_aligned to allocate an aligned memory block within a chunk of shared memory, how do I then identify that same block in another process ? E.g.

managed_shared_memory managed_shm(open_or_create, "SharedMemory", 65536);
void *ptr = managed_shm.allocate_aligned(256, 16);

How do I then find ptr from within another process ?

For non-aligned allocations I just use find_or_construct and then obviously there is a name associated with the allocation which makes it possible to find the allocation from another process. However there doesn’t seem to be any way to do aligned allocations with find_or_construct and evidently I must be missing some fundamental point as to how to identify anonymous allocations.

  • 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-06-14T11:45:44+00:00Added an answer on June 14, 2026 at 11:45 am

    Example from the docs included below. This is applicable to pointers to memory returned allocate_aligned method as well as the vanilla allocate method.

    //Process A obtains the offset of the address
    managed_shared_memory::handle handle = 
       segment.get_handle_from_address(processA_address);
    
    //Process A sends this address using any mechanism to process B
    
    //Process B obtains the handle and transforms it again to an address
    managed_shared_memory::handle handle = ...
    void * processB_address = segment.get_address_from_handle(handle)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to allocate virtually contiguous range memory so that I can use the
I knew that when we allocate memory by using new/new[], then we should release
I want to allocate a certain amount of memory upfront and use that memory
I allocate a color entry with the next code, then I use it to
If I use .reserve(items) on a vector, the vector will allocate enough memory for
When we use malloc() to allocate memory, should we give the size which is
According to some textbooks, the compiler will use sub* to allocate memory for local
I want to allocate and initialise a fairly large chunk of contiguous memory (~1GB),
When I try to use realloc to allocate memory for a pointer which has
I tried to use forall to allocate dynamic arrays, but gfortran didn't like that.

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.