Menu

some concepts

Help
2003-08-17
2003-08-18
  • stephen crane

    stephen crane - 2003-08-17

    hi,bumble:
    what is the relationship of segment,page,chunk and block?
    these four concepts sometimes confused me while i'm reading your code.

    please tell me the difference.

    many thanks

     
    • stephen crane

      stephen crane - 2003-08-17

      and what is element means here?
      i think the allocator manage the shared memory in a segment-page form.that is,a shared memory is a segment,which contains pages of equal size.a chunk contains some pages of a single segment(or multi-segment?),but a block is a actual structure in a page and it should not be larger than page size.
      and an element means...

      well, i got confused.please give me some indication.thanks

       
    • stephen crane

      stephen crane - 2003-08-17

      oh,a segment is the shared memory applied by a alloc_key,but block and element and page are the same. i think.they are mark by allocator_bit_vector,which is contained at each segment,right after shared_memory_header_t.

       
    • stephen crane

      stephen crane - 2003-08-17

      allocator_bit_vector is also use in shared template class,but this time it represents segments,not pages.

       
    • stephen crane

      stephen crane - 2003-08-17

      since allocator_bit_vector is a general class(it can manage segments and pages each),so a more general name must be used.you choose elements and blocks,right?

       
    • stephen crane

      stephen crane - 2003-08-17

      i think i know now.
      segment contains pages and chunk.
      chunk is allocated by pages.
      but chunk is used in elements of class T.
      both chunk and segment has it's own header and vector_bit at the beginning.

      well done!

       
    • Marc Bumble

      Marc Bumble - 2003-08-18

      Stephen,

      Thanks for your continued interest in the allocator.  I have a couple of articles submitted documenting the project.  I am waiting for their publication.  Then I will post them in the document section of the project.  The articles answer the questions you ask.

      For the bug report you posted, these are mistakes.  I have corrected them in the CVS repository and will post the fixes in the next release.  What i think the system really needs is a regression test case which fails due to the oversights you found.  So, far the code works regardless of the missing tests for this_chunk == 0, as I think that case never comes up, but the test for the 0 condition should be there.  I agree.

      Can you think of  a regression test case which would spot the this_chunk == 0 error?

      Marc

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.