dcsimg
Results 1 to 17 of 17

Thread: LARGEADDRESSAWARE ... anyone actually using it?

  1. #1

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

    LARGEADDRESSAWARE ... anyone actually using it?

    Hi all,

    Is anyone out there actually using the LARGEADDRESSAWARE option? And, if so, have they also turned on the AllocationPreference so that memory is allocated from top-down rather than bottom-up, which would be a much better test of whether LARGEADDRESSAWARE works properly?

    I recently read this article, and it makes a great deal of sense to me. Specifically, do we know that all the VB6 runtimes have been thoroughly tested with LARGEADDRESSAWARE? If not, then we can probably toss all considerations of ever using it.

    I'm just wondering if I truly need to always plan for this stuff when I'm doing memory-pointer math. If LARGEADDRESSAWARE is something that's truly not on the table, then why do we worry about it?

    Regards,
    Elroy
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  2. #2

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

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Actually, with small offsets being added to memory addresses, I'm not sure that even turning on AllocationPreference gives us a good test. It's only when our offset addition crosses the 2GB boundary (i.e., toggles the sign bit of a Long) that we have a problem. Therefore, we'd have to actually be at the threshold of using exactly 2GB before we'd actually be doing a test.

    And, to make matters worse, we'll never know exactly which code will be executing that will test that threshold. Any program that uses that much memory will almost certainly be a somewhat complex program. Therefore, we'll never be certain as to which code (or even which component) is crossing that threshold. It might be our base EXE code, it might be some class we've instantiated, it might be some ActiveX component we've written, it might be one of the VB6 runtime DLLs, it could be some system dll such as GDI+ or DirectX, or it could even be some core Windows DLL.

    I'm guessing that the base Windows DLLs are good to go. However, I've never seen anything that says the VB6 runtimes are all tested for LARGEADDRESSAWARE. You would hope that the UI4 type (unsigned long int) was used for all memory pointers in these DLLs, but I doubt we'll ever see any source code for the vast majority of them.
    Last edited by Elroy; Jun 23rd, 2019 at 11:00 AM.
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  3. #3
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Quote Originally Posted by Elroy View Post
    I'm just wondering if I truly need to always plan for this stuff when I'm doing memory-pointer math. If LARGEADDRESSAWARE is something that's truly not on the table, then why do we worry about it?
    Don't know the answer to your primary question, but will be monitoring this thread to find out. Regarding that final question -- if you are writing a component that can be used in someone else's project, i.e., class, uc, etc., then I'd say it is a consideration because you have no control over whether that person has added LARGEADDRESSAWARE-ness to their project, the project that is hosting your code.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  4. #4

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

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Quote Originally Posted by LaVolpe View Post
    ... if you are writing a component that can be used in someone else's project, i.e., class, uc, etc., then I'd say it is a consideration because you have no control over whether that person has added LARGEADDRESSAWARE-ness to their project, the project that is hosting your code.
    Good point. I suppose ActiveX distribution is still somewhat alive-and-well, possibly even for MS-Office VBA products (32-bit of course). Apparently, at least for Excel, it is an option (according to this KB).
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Thinking out loud. You can probably play with this somewhat. We can request memory at any 4K boundary via VirtualAlloc. Thinking that if you do so, at a range just before the 2GB boundary and a block of memory that would exceed that boundary, then it might be test worthy. For example, you can use CopyMemory to write a string of bytes out there, then create a SafeArray structure with the pvData pointing to that 1st byte and assigning the SafeArray to a VB Byte() array. Loop thru the VB array and see if there are any problems. This is only an idea for testing. Certainly doesn't answer the question whether VB is 100% compatible with LARGEADDRESSAWARE.

    At the thunk (asm) level, the execution: add eax, edx does pointer math just fine when eax is less than 2GB and edx is a value that would push the result over the 2GB boundary. One could assume, that is what VB would do at the machine level. The result is the same as if you were to use MS Calculator (programmer mode, hex mode) to add: 7FFFFFFF + 1234

    edited: simple thunk to add/subtract 2 numbers. Will return adjusted overflow value if applies
    Code:
    Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
    Private Declare Function VirtualAlloc Lib "kernel32.dll" (ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
    Private Declare Function VirtualFree Lib "kernel32.dll" (ByVal lpAddress As Long, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
    Private Declare Function CallWindowProc Lib "user32.dll" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
    ' routine
        Const thunkLen As Long = 6
        Const CB_PAGE_RWX    As Long = &H40         ' Allocate executable memory
        Const CB_MEM_COMMIT  As Long = &H1000       ' Commit allocated memory
        Const CB_MEM_RELEASE   As Long = &H8000&    ' Release allocated memory flag
        
        Dim vMem As Long
        Dim z_Sc(0 To thunkLen - 1) As Long
        
        z_Sc(0) = &H424448B: z_Sc(1) = &H824548B: z_Sc(2) = &H10247C83: z_Sc(3) = &H29047400: z_Sc(4) = &H102EBD0: z_Sc(5) = &H10C2D0
        vMem = VirtualAlloc(0&, thunkLen * 4&, CB_MEM_COMMIT, CB_PAGE_RWX)
        CopyMemory ByVal vMem, z_Sc(0), thunkLen * 4& ' copy thunk to memory
        
        ' pass 2 numbers to add/subtract in the 1st 2 params
        ' pass 4th param as zero to add else non-zero to subtract
        Debug.Print Hex(CallWindowProc(vMem, &H7FFFFFFF, &H1234, 0, 0))
        
        VirtualFree vMem, 0&, CB_MEM_RELEASE
    The thunk is simply:
    Code:
    mov		eax, [esp + 4]	; param1
    mov		edx, [esp + 8]	; param2
    cmp dword 	[esp + 16], 0x0 ; param 4
    je		_addNumbers
    sub		eax, edx
    jmp		_exitRoutine
    _addNumbers:
    add		eax, edx
    _exitRoutine:
    ret 0x10
    Last edited by LaVolpe; Jun 23rd, 2019 at 12:49 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

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

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    So LaVolpe, to infer a bit from your thinking ... you're thinking that the VB6 runtimes are probably LAA safe? I've got no idea, but I assume they're written in either C or C++, which should probably work just fine (but that's not totally guaranteed).

    What concerns me is that, apparently, Excel wasn't LAA safe until sometime after 2013 (which isn't that long ago in VB6 terms). If we can't trust the VB6 runtimes to be LAA safe, then it would seem that we can't trust anything written in VB6 to be LAA safe.
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    No, I don't know. But why would there be such a linker option if it wasn't? Wouldn't even know if that option would tempt VB into requesting memory outside the 2GB boundary. I know I've asked the question before ... is it possible for memory addresses to cross over that boundary & Bonnie replied that it was when LAA was in play. But like you, I haven't seen any "proof" one way or the other.

    As I said in my 1st reply -- will be monitoring this to see the back & forth.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  8. #8
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,477

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Quote Originally Posted by LaVolpe View Post
    Thinking out loud. You can probably play with this somewhat. We can request memory at any 4K boundary via VirtualAlloc.
    I'm in deep shock reading this. . . If it's possible to allocate an 8KB block starting at 2GB-4KB to 2GB+4KB permanently this will make all UnsignedAdd usage throughout my code obsolete.

    This will probably stabilize many 3rd party and 1st party components too, including the runtime and in my case ADO being the main memory consumer.

    All my apps are LAA and some of my clients regularly hit OOM (at about 3.7GB nowadays on x64 OSes). So this means that the runtime works, ADO works, and probably only the 2GB boundary is problematic for 3rd party controls written in VB6 that I have no control over. I cannot identify which errors are directly caused by LAA troubles in my error logs as usually the errors (remaining) there are very weird and could be anything else (as weird).

    cheers,
    </wqw>

  9. #9
    Hyperactive Member
    Join Date
    Feb 2019
    Posts
    382

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    The reasons that Intel and many others chose Two's complement to represnt negative numbers is because they can use the same Addition/Subtraction circuitry for both Signed/Unsigned numbers, in other words, they don't have to add more transistors. It just works for both all Signed and Unsigned values like Magic. So for these numbers:

    &H7FFFFFFF: in Decimal +2147483647(Both Signed/Unsigned)

    Add one(In C++):
    &H80000000: in Decimal: -2147483648(Signed with Overflow), +2147483648(Unsigned).

    In C++, overflows are ignored. In VB6, Overflows are on by default, so pointer additions in your code generate Overflow errors, and the calculation is not done even if you have On Error Resume Next. If you turn Overflow off, then the result is the same as C++: the binary result is correct. Here is some test code:

    Code:
    Option Explicit
    
    Private Sub Form_Load()
        Dim i As Long
        
        On Error Resume Next ' Optional for EXE mode when Overflow is turned off
        
        i = &H7FFFFFFF
        i = i + 1
        MsgBox Hex(i) & Str(i)
    End Sub
    
    IDE Output(With Overflow on or off, the result is the same):
    7FFFFFFF 2147483647 
    
    EXE Output(With Overflow at the default on):
    7FFFFFFF 2147483647 
    
    EXE Output(With Overflow turned off):
    80000000 -2147483648
    What may cause problems is signed multiplication and division, but I believe rarely if any at all. One example if there is a UDT or Class array of size 50 Bytes, then pointer calculation might be:

    Pointer = StartAddress + 50 * Index

    It's unlikely that you have an array of such size that 50 * Index exceeds 2 GB. In the case above, you have to have 42,949,673 elements to exceed 2 GB. My testing when StartAddress is &H7FFFFFFF and Index=100 shows correct binary result with EXE+OverflowOff, but I don't know if all processors out there give the same result, but they probably are. If StartAddress is &H80000000 or more, the result is binary correct with EXE+OverflowOff.

    One solution rather than using LARGEADDRESSAWARE is using Memory Mapped Files. You can map 100 GB file or use the paging file, and only allocate 1 GB(or 100 MB) at a time. You can switch the 1 GB away for another one and process that. I think the switch is quick if the system already has the other GB in RAM, but I haven't used memory mapped files yet. This allows you to use more than 4 GB. Search this forum or MSDN for MapViewOfFile for samples(Off topic: No code samples in the CodeBank. Anyone up for making a Class sample and put it up in the Codebank? Thanks).
    Last edited by qvb6; Jun 23rd, 2019 at 01:40 PM.

  10. #10

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

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Quote Originally Posted by wqweto View Post
    So this means that the runtime works, ADO works...
    Now, unless my thinking is somehow wrong, we have to be careful with a statement like that. Personally, I think it's probably true ... however...

    If I understand things correctly, it's only a problem when our memory address addition crosses the 2GB boundary. If all is below it, we're fine. And, if all is above it, we're fine. It's only when the original address is below, and the offset makes us cross it, that gets us into trouble.

    So, when do we add offsets to memory addresses? All the time! A trivial example is an array. We have the base data address, and we add offsets to get to individual array elements. However, if we show that this is LAA-safe, that's only one aspect of testing VB6 code. How about when just accessing a BSTR string, and we apply offsets to find the length and/or StrZ address? That's code entirely separate from addressing array elements.

    If I had to guess, I would say that the vast majority of VB6 functions probably use memory pointer offsets. To be sure we were totally LAA-safe, we'd have to test every one at them, placing each of them on the 2GB boundary for a good test.

    Or, in the alternative, we could stare at the source-code and make sure that Unsigned Longs were used (or that some kind of LAA-safe math was used). As the article I referenced in the OP, it does seem to be a bit of a time-bomb. Again, I suspect we're fine, but there's certainly no statement by Microsoft that I know of that declares this.

    Just a word about the linker: Personally, I've always viewed the linker (even the one distributed with the VB6 IDE) as having a usage scope beyond VB6. Just because it supports the LAA flag doesn't necessarily mean that all of VB6 is LAA-safe. I suspect (for the most part) the linkers that Microsoft distributes are all fairly derivative from the same code-base.

    Wqweto, it's definitely a positive sign that someone is actually using LAA without problems.

    Best Regards,
    Elroy

    @qvb6: Yeah, the fact that (most likely) none of the VB6 runtimes (or any other core DLLs) are written in VB6 is what probably protects us. If I had the option in VB6, I'd certainly use an Unsigned Long for all of my memory pointer work. However, it's still puzzling that Excel wasn't LAA-safe until after 2016.
    Last edited by Elroy; Jun 23rd, 2019 at 01:45 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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  11. #11
    Hyperactive Member
    Join Date
    Feb 2019
    Posts
    382

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Quote Originally Posted by Elroy View Post
    How about when just accessing a BSTR string, and we apply offsets to find the length and/or StrZ address?
    I think VB always uses SysStringLen API function and sister functions for strings, but I am not seeing functions for Mid/Left/Right/Chr/Asc. According to the old 1996 article "Article 3. Strings the OLE Way" in MSDN Oct 2001, subtopic "The Eight Rules of BSTR", here is Rule #1:

    Rule 1: Allocate, destroy, and measure BSTRs only through the OLE API (the Sys functions).
    Those who use their supposed knowledge of BSTR internals are doomed to an unknowable but horrible fate in future versions. (You have to follow the rules if you don't want bugs.)
    Based on this it's most lkely that VB uses the API for strings. Making assumptions such as the length is a 4 byte at the beginning followed by the actual string could break if MS changes COM so it's stored in another way. One has to use the API if available. In Rule#2, the author says that the last character you should touch is the last character in the string, and not the extra two byte null. MS again could change this so there are no extra nulls.

    Again I am not seeing functions for Mid/Left/Right/Chr/Asc. Either I missed them, or VB uses it's own methods to come up with the values.

  12. #12
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,234

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    When I see statements like those above, sometimes I just roll my eyes. I doubt seriously that BSTR, for example, will change. If anything, maybe there may be a BSTR2 but not changing the format of the current BSTR. I understand the warning and, in general, appreciate it. Just think it was probably a bad example for such a warning. Typically with COM, you don't modify an existing "object", you enhance it with another, unique object.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  13. #13
    Hyperactive Member
    Join Date
    Feb 2019
    Posts
    382

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Yes, I agree with you, changing BSTR now would break a lot of apps, but my point is that MS was propably following these rules when they made VB6, i.e. use the API when available.

  14. #14
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,477

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Quote Originally Posted by Elroy View Post
    If I understand things correctly, it's only a problem when our memory address addition crosses the 2GB boundary.
    There is no such problem on hardware level (adding registers) and this overflow is *explicitly* checked by VB6 generated code so it's kind of self-inflicted. There is no such problem in VB6 runtime and/or ADO for instance.

    Quote Originally Posted by Elroy View Post
    And, if all is above it, we're fine.
    Some weird C/C++ apps use MSB for their own purposes, so these cannot address "negative" process space (above 2GB). This is very rare.

    Another trouple is the so called size_t type in C/C++ -- it was not actively used as devs assumed int is good enough but with LAA array sizes might overflow into negative.

    Also there is ptrdiff_t which is the difference b/n 2 pointers. In LAA this can be up to 4GB *and* have a sign so its effectively 33-bit value. I'm not sure how this is solved, probably still using signed 32-bit which is potentially not correct but w/ no effective consequences because of the 2-complement signed arithmetic.

    cheers,
    </wqw>

  15. #15
    Lively Member
    Join Date
    Mar 2019
    Posts
    64

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    I use largeaddressaware in two of my projects. One is the datacollection layer in my monitoring system. Memory consumption gets quite large in this when you have 500 devices in one data collection instance. The only real issue I had was incorrectly for returned handles being & addresses from some of my c++ code > 0 when in fact they can often be < 0 as they are usually returned as a signed long in VB so its best to test for <> 0.

    The other component does some network traffic synthetics and has a thread for each device that it talks to. Without LAA it use to croak after creating some number of threads. I forget how many. With LAA it can handle a couple of thousand devices.

    I don't really do pointer maths except in some limited ways in some of the other components that are not LAA.

    This feature saved my bacon actually because it allowed me to scale my data collection code up without having to convert it to something else.

    EDIT. Data collection runs 7x24 for months and months without a restart so I assume the run time is good to go.
    Last edited by vbwins; Jun 25th, 2019 at 07:12 AM.

  16. #16

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

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    @vbwins: Good point about pMemory > 0 versus pMemory <> 0. That could introduce a bug in any language, and there are many cases where a memory pointer of zero could be returned to indicate some abnormal situation. If we intend to use LAA, we should be careful to use the pMemory <> 0 approach.
    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. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  17. #17
    Lively Member
    Join Date
    Mar 2019
    Posts
    64

    Re: LARGEADDRESSAWARE ... anyone actually using it?

    Yes you have to do it with malloc etc. Pretty anything that returns an address, handle etc.

    This took me a while to figure out when I converted my code to be LAA because as you would expect it worked some of the time (<2gig) and behaved in strange ways other times (>2gig)

    all good fun.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width