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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:50:16+00:00 2026-05-29T10:50:16+00:00

I will be allocating and deallocating MANY dynamic, multidimensional arrays that represent matrices, every

  • 0

I will be allocating and deallocating MANY dynamic, multidimensional arrays that represent matrices, every frame.

Priorities, even at the expense of error-checking and manual memory management:

  1. Speed
  2. Small memory footprint

Are C-style arrays the best choice, given these priorities? I know this is an oft-asked question, but I haven’t been able to find a definitive answer for my circumstance.

  • 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-29T10:50:18+00:00Added an answer on May 29, 2026 at 10:50 am

    If you can characterize the maximum amount of memory needed for a set of these arrays that will be used for any particular ‘frame’ (whatever that is), and if you will be dealing with only a single frame at a time (in other words, you’ll be performing work on a single set of arrays, then dumping all of those arrays before performing another round of work on another set of arrays) then you’ll likely get the best performance by allocating your arrays from a block of static memory that you’ve size appropriate for your largest possible work set.

    Then your array allocation can be a simple pool allocator that carves out memory for an array from the front of the block and adjusts the block pointer to just past that allocation to be ready for the next array allocation. When you’re done with the work on that set of arrays, everything can be freed by ‘cleaning the pool’ – simply resetting the block pointer to the start of the static memory pool.

    Of course, since you haven’t given much in the way of details for how your work must be done, this technique might not fit at all (that’s probably why you haven’t found a definitive answer yet – such an answer depends on the specific characteristics of the work you’re performing).

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

Sidebar

Related Questions

It is widely known common sense, that for most algorithms, allocating and deallocating data
I see that many people are allocating and releasing NSStrings. I understand that the
One strategy that I though of myself is allocating 5 megabytes of memory (or
What's the right way to do this? I have an array that I will
Every now and again I find myself doing something moderately dumb that results in
D's docs saying that when you use scope for local variables, then they will
In my application, right now it seems that Core Data is busy allocating space
I'm allocating my pthread thread-specific data from a fixed-size global pool that's controlled by
I know that the compiler will sometimes initialize memory with certain patterns such as
I'm writing some pretty CPU-intensive, concurrent numerical code that will process large amounts of

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.