Page 2 of 2 FirstFirst 12
Results 41 to 49 of 49

Thread: Arrays in Far Memory

  1. #41
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: Arrays in Far Memory

    I don't understand why FlushViewOfFile is necessary at all.

  2. #42

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: Arrays in Far Memory

    Quote Originally Posted by The trick View Post
    You could use this class which provides the ability to alloc dynamic memory in a memory mapped file. You can use variable length strings, UDTs etc.
    Trick, I'm not up for building a test at this moment. However, I'm guessing, if pushed hard enough, you'll have the same problems I'm having, as you're using the same API calls.

    ----------

    I see that you're making some Interlocked... API calls though. I might need to study what you're doing and see if that's the solution.

    ----------

    Also, it doesn't look like you're attempting to break the 2GB (or 4GB) boundary, as your lMaxSize is just a Long.
    Last edited by Elroy; Jul 1st, 2022 at 03:40 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  3. #43

  4. #44
    PowerPoster
    Join Date
    Feb 2015
    Posts
    2,671

    Re: Arrays in Far Memory

    Quote Originally Posted by Elroy View Post
    Trick, I'm not up for building a test at this moment. However, I'm guessing, if pushed hard enough, you'll have the same problems I'm having, as you're using the same API calls.
    I've described the reason of the error in the MemoryBasedArray class.

    Quote Originally Posted by Elroy View Post
    I see that you're making some Interlocked... API calls though. I might need to study what you're doing and see if that's the solution.
    My class is intended for sharing between processes so it requires the atomic access when you change the memory layout.

    Quote Originally Posted by Elroy View Post
    Also, it doesn't look like you're attempting to break the 2GB (or 4GB) boundary, as your lMaxSize is just a Long.
    Yes my class supports only 32-bit offsets.

  5. #45

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: Arrays in Far Memory

    Quote Originally Posted by The trick View Post
    I've described the reason of the error in the MemoryBasedArray class.
    Ahhh, thank you. I missed it somehow. And missing your posts is not something I should be doing.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  6. #46
    PowerPoster
    Join Date
    Feb 2017
    Posts
    4,995

    Re: Arrays in Far Memory

    In The Trick's class he does not use FlushViewOfFile.

  7. #47

  8. #48

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: Arrays in Far Memory

    Yeah, I'll soon look at what he did, and fix my class (using his guidance). I'm just sort of indolent right now.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

  9. #49

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,852

    Re: Arrays in Far Memory

    Ok, I've fixed the problem Eduardo was having (with the bug pointed out by The Trick).

    I'm also going to move this whole thing over to the CodeBank. Please continue the discussion over there.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width