473,770 Members | 5,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Large Object within Pointer to Function & Switch

Do you know that current C++ Compiler limits to 64KB segments in source
code? It is good news that Microsoft Visual C++ 2005 has expanded to 4GB
segments in source code. 4GB segment is ideal for large object using
pointer to function and switch. Please list other C++ Compilers if they
have added a support of 4GB segments.
I am able to write 65,536 functions and 65,536 function's memory address
is stored into pointer to function list. It takes about 256KB. The test
has shown that each function out of 65,536 functions have been executed
successfully with correct result in both debug version and release version.
Switch can contain 65,536 cases in debug version, but C++ Compiler takes
more time to compile than pointer to function. Unfortunately, it will not
compile in release version. Unknown error is not found in any
documentation. (Not important to discuss this issue.)
I think that it is best practice to write small functions through
pointer to function list rather than large switch in one big function. By
the way, small functions can fit in cache. (Correct?).
If you are going to write 1 to 268,435,456 functions, memory address in
pointer to function list will take up to 1GB.
I know what you are going to say -- laugh -- can't be done. I urge you
to try if you are willing to write complex project. Think about holographic
character like Star Trek or character for game what you want to write. This
big object contains body including head, arm, leg, and everything. You need
to write hundred or thousand functions to respond moving arm, leg, and head.
More functions to be responded for mouth talking.
It makes 32-bit CPU machine to be slower to manipulate C++ Compiler for
large object so 64 bit CPU machine may be working with large RAM.

Please tell me what you think the best practice. Live with big object
by adding /bigobj and /Gy to Microsoft C++ Compiler. Check option
documentation for other C++ Compilers. Should write large pointer to
function list in more than 1 million line of source code? Or...Split half
or quarter function to pointer list into two or four module source code?

Please refer me to other newsgroups when I am interested to work large
object using optimization and performance using C++ Compiler's option, but
not through Microsoft alone. Please advise.

Bryan Parkoff
Oct 28 '06 #1
14 1957
Bryan Parkoff wrote:
Do you know that current C++ Compiler
What's that? Where could I find "current C++ Compiler"? Are you
talking of the Standard requirements?
limits to 64KB segments in
source code?
No, I never heard of such thing. But then again, I cannot claim
I've heard everything... The Standard, however, imposes no such
limitation. I know that there are _minimal_ quantities *recommended*
for implementations , but I can't find "segments in source code" among
those.
It is good news that Microsoft Visual C++ 2005 has
Product-specific discussions are generally off-topic here. Each
product most likely has at least one dedicated newsgroup. I know
that VC++ certainly does, even more than one.
expanded to 4GB segments in source code. 4GB segment is ideal for
large object using pointer to function and switch. Please list other
C++ Compilers if they have added a support of 4GB segments.
Please list operating systems you want to learn about. Then please
realise that discussions specific to OS are also off-topic. There
are newsgroups for those things.
[..]
Please refer me to other newsgroups when I am interested to work
large object using optimization and performance using C++ Compiler's
option, but not through Microsoft alone. Please advise.
Try 'comp.os.ms-windows.program mer.*' hierarchy or 'microsoft.publ ic.*'
hierarchy.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 28 '06 #2
Bryan Parkoff wrote:
Do you know that current C++ Compiler limits to 64KB segments in source
code? It is good news that Microsoft Visual C++ 2005 has expanded to 4GB
segments in source code. 4GB segment is ideal for large object using
pointer to function and switch. Please list other C++ Compilers if they
have added a support of 4GB segments.
phuff - gcc supports 9,223,372,036,8 54,775,807 byte segments.

Now I'm looking for a computer with that much memory, one that can write
to all of it in a few seconds.

Oct 28 '06 #3
Gianni Mariani <gi*******@mari ani.wswrote:
>Bryan Parkoff wrote:
> Do you know that current C++ Compiler limits to 64KB segments in source
code? It is good news that Microsoft Visual C++ 2005 has expanded to 4GB
segments in source code. 4GB segment is ideal for large object using
pointer to function and switch. Please list other C++ Compilers if they
have added a support of 4GB segments.
>phuff - gcc supports 9,223,372,036,8 54,775,807 byte segments.
How are you guys defining "segment"?

Steve
Oct 28 '06 #4
>> Do you know that current C++ Compiler limits to 64KB segments in
>>source
code? It is good news that Microsoft Visual C++ 2005 has expanded to
4GB
segments in source code. 4GB segment is ideal for large object using
pointer to function and switch. Please list other C++ Compilers if they
have added a support of 4GB segments.
>>phuff - gcc supports 9,223,372,036,8 54,775,807 byte segments.

How are you guys defining "segment"?
Steve,

Sorry. My mistake. I refer section (not segment). Look this article
below.

Microsoft Article:

By default, an object file can hold up to 65,536 (2^16) addressable
sections. /bigobj increases that address capacity to 4,294,967,296 (2^32).

Most modules will never generate an .obj file that contains more than 65,536
sections. However, machine generated code, or code that makes heavy use of
template libraries may require .obj files that can hold more sections.

An .obj file produced with /bigobj can only be consumed by a linker that
shipped in Visual C++ 2005 (or later). Linkers that shipped prior to Visual
C++ 2005 cannot read .obj files that were produced with /bigobj.

End of article

You know when you attempt to write 65,536 lines or greater on some C++
Compilers. It will fail to compile because of exceeded limit to 64KB
section. I think the point is that each object and source code are limited
to 64KB. Now, big object and big source code can handle 4GB section. It is
wonderful. It helps very much with pointer to function list.

Bryan Parkoff
Oct 28 '06 #5

"Gianni Mariani" <gi*******@mari ani.wswrote in message
news:45******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Bryan Parkoff wrote:
> Do you know that current C++ Compiler limits to 64KB segments in
source code? It is good news that Microsoft Visual C++ 2005 has expanded
to 4GB segments in source code. 4GB segment is ideal for large object
using pointer to function and switch. Please list other C++ Compilers if
they have added a support of 4GB segments.

phuff - gcc supports 9,223,372,036,8 54,775,807 byte segments.

Now I'm looking for a computer with that much memory, one that can write
to all of it in a few seconds.
Well, it is going to be 8,388,608 TeraByte. What will you call if 8,388,608
is divided by 1,024 = 8192 "?"Byte. "?" reminds you to invent new name.
18,446,744,073, 709,551,616 is the maximum of 64 bit register.
(0x100000000000 00000 - 1)

Bryan Parkoff
Oct 28 '06 #6
Bryan Parkoff wrote:
.... What will you call if 8,388,608
is divided by 1,024 = 8192 "?"Byte. "?" reminds you to invent new name.
Kilo (2^10), Mega (2^20), Giga (2^30), Tera (2^40), Peta (2^50), Exa
(2^60), Zetta (2^70), Yotta (2^80)
Oct 29 '06 #7
Gianni Mariani wrote:
Bryan Parkoff wrote:
... What will you call if 8,388,608
>is divided by 1,024 = 8192 "?"Byte. "?" reminds you to invent new
name.

Kilo (2^10), Mega (2^20), Giga (2^30), Tera (2^40), Peta (2^50), Exa
(2^60), Zetta (2^70), Yotta (2^80)
http://en.wikipedia.org/wiki/Kibi
Oct 29 '06 #8
Bryan Parkoff wrote:
Microsoft Article:
By default, an object file can hold up to 65,536 (2^16) addressable
sections. /bigobj increases that address capacity to 4,294,967,296 (2^32).
(blahblah)
You know when you attempt to write 65,536 lines or greater on some C++
It will fail to compile because of exceeded limit to 64KB section.
The article talks about Microsoft compilers for Windows, not "some".

And there is no direct relation between the number of lines of the source
file and the limits of whatever structure in an object file (unless it
embeds the lines in such limited structure as part of debug information).

--
Salu2
Oct 29 '06 #9
Gianni Mariani wrote:
Kilo (2^10), Mega (2^20), Giga (2^30), Tera (2^40), Peta (2^50), Exa
(2^60), Zetta (2^70), Yotta (2^80)
This usage is obsolete. See http://en.wikipedia.org/wiki/Binary_prefix

--
Salu2
Oct 29 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1777
by: Patrick | last post by:
I want to achieve the following behaviour but I am having trouble getting there...bare with me im knew to c++ , so its probably rather trivial! To have a class ClassA, and composed within this class is an instance of another class, ClassB. I want to have a method getClassB that returns a reference to the instance of ClassB composed within ClassA. So when a client calls getClassB they are supplied with a reference to the instance of...
6
3709
by: Ian Robertson | last post by:
I am trying to write a function that takes a reference to an object as its arguement. The object is created in another function and I am trying to pass the object to another function from within the function that created the object. I have cut out some code as I dont think showing a for loop is helpful. void TMP3_Main_Form::LoadMP3() { TMemoryStream *MP3Stream = new TMemoryStream();...
35
3047
by: Frederick Gotham | last post by:
(Before I begin, please don't suggest to me to use "std::vector" rather than actual arrays.) I understand that an object can have resources (e.g. dynamically allocated memory), and so we have to copy an object properly via copy- construction rather than using memcpy. However, is it okay to move an object manually (i.e. by using memcpy or memmove)?
20
4285
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
14
2581
by: Jeroen | last post by:
Hi all, I've got a question about writing a library. Let me characterize that library by the following: * there is a class A which is available to the user * there is a class B that is used in severel 'underwater operations' * there is a list which stores objects of class B There are several issues I'm not sure about:
9
5014
by: grbgooglefan | last post by:
I am trying to pass a C++ object to Python function. This Python function then calls another C++ function which then uses this C++ object to call methods of that object's class. I tried something like this, but it did not work, gave core dump. class myclass { public: myclass(){}; ~myclass(){};
10
2051
by: sumsin | last post by:
The C++ Object Model book says that 'Nonstatic data members are allocated directly within each class object. Static data members are stored outside the individual class object. Static and nonstatic function members are also hoisted outside the class object. Virtual functions are supported in two steps: A table of pointers to virtual functions is generated for each class (this is called the virtual table). A single pointer to the...
3
3343
by: Giovanni Gherdovich | last post by:
Hello, in the following code I have a pointer (to function), say p, of type double (*)(double, double, void*) and I try to fix the second argument of the function *p to a given value (using boost::bind), but the compiler complains, because of a type mismatch in an assignment which I think should be legal:
2
4308
by: bips2008 | last post by:
The code seems to work fine in other browser but in IE it throws this error. This is very urgent for me and any help would be greatly appreciated For your convienence i have posted the code for the file. The portion that is not working is the star rating part <?php session_start(); include_once('includes/host_conf.php'); include_once('includes/db_connect.php'); include_once('includes/mysql.lib.php');...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.