Re: structure size limitation in VS C++ 6.0?

From: Sylvain Lafontaine ("Sylvain)
Date: 07/22/04


Date: Thu, 22 Jul 2004 10:36:14 -0400

In my opinion, there should be no problem if you allocate it on the heap.
If you want to be sure, you can replace your user defined structure with a
pointer and allocate it separately.

What is exactly the problem that you are having?

S. L.

"Carolyn Sano" <Carolyn Sano@discussions.microsoft.com> wrote in message
news:0D4A6AAD-8F6A-4F97-9B9E-7AAA37DABA38@microsoft.com...
> I have a large structure that has the following members:
> typedef struct
> {
> int nNumber1;
> USERDEFINED_STRUCT nStruct; (user defined structure)
> int nNumber2;
> int nNumber3;
> char szField1[257];
> ...
> char szField255[257];
> } MY_STRUCT;
>
> I checked the size returned by sizeof() and it's 65568. Does anyone know
if a structure of this size can't be handled in VS C++ 6.0 (bigger than
2^16-1)? We suspect that the problem lies in our code, but we want to be
sure that Dev Studio can handle a structure of this size. Thanks.
>
> P.S. I'm running on Windows 2000.



Relevant Pages

  • Re: Huge pages and small pages. . .
    ... >> what looks like contiguous memory and away you go. ... you need to have them cached in the TLB; if the TLB runs out of ... > low end of the heap, until someone figures out a way to tell the system ... When you allocate memory, the kernel just marks a promised ...
    (Linux-Kernel)
  • Re: Struct inside class
    ... The compiler figures computes the ... including anything derived from "Object": Heap pointer ... memory leaks and why the .NET good garbage collector is required. ... If GC_ALLOCATE can't allocate the requested ...
    (microsoft.public.dotnet.framework)
  • Re: Struct inside class
    ... From the previous discussion, we know that i1 is a member variable of a strunct in a class, so it's stored on the heap. ... but inside the allocated space for the reference type instance. ... memory leaks and why the .NET good garbage collector is required. ... If GC_ALLOCATE can't allocate the requested ...
    (microsoft.public.dotnet.framework)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (comp.lang.cpp)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (alt.comp.lang.learn.c-cpp)

Quantcast