comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Storing !NULL in struct
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Storing !NULL in struct [message #83627 is a reply to message #83531] Fri, 15 March 2013 13:40 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi all,

Not to stir the pot some more, but I actually looked into supporting !null in IDL structures. The deal-killer was that IDL structures are supposed to map directly to C structures. So you can theoretically take an IDL structure, write it out to a file, and then define a corresponding structure in C code and read it into that program. So having a !null field would break that compatibility.

Also, there were major issues of memory management. For named structures, if you allowed !null as a field, and then you decided to assign it a value, you would need to track down every instance of that named structure and re-define it. Even if you only allowed !null for anonymous structures, you could have an array of those structures. If you then defined the !null field in the first structure of the array to have some value, you would have to copy the entire array, and reallocate every structure to have the new value.

In short, it was just too much of a code overhaul and backwards compatibility risk to allow !null in structures.

As Mike suggests, perhaps HASH is the way to go.

Cheers,
Chris
ExelisVIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HASH makes too many temporaries
Next Topic: MGlib IDL library

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 22:29:07 PDT 2025

Total time taken to generate the page: 0.16769 seconds