{"id":4720,"date":"2014-03-30T14:57:28","date_gmt":"2014-03-30T14:57:28","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-store-lot-of-read-only-data-in-dll-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:57:28","modified_gmt":"2014-03-30T14:57:28","slug":"how-to-store-lot-of-read-only-data-in-dll-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-to-store-lot-of-read-only-data-in-dll-collection-of-common-programming-errors\/","title":{"rendered":"How to store lot of read-only data in DLL?-Collection of common programming errors"},"content":{"rendered":"<p>I need a way to store lot of numerical read-only data (double values) in a DLL. Data must be embedded in source, because it will be changed from time to time &#8211; no external tools like Visual Studio etc., only code generation+shell compiler.<\/p>\n<p>I know that it is a bad practice, but this is &#8220;business requirement&#8221;.<\/p>\n<p>I need to store about <strong>2 000 000 of 32-bit float values<\/strong>. This should be about 8MB raw data. Assume that DLL size limit is 100MB. Language is <strong>Fortran<\/strong>.<\/p>\n<p>My first thought was to generate value assignments to dynamic array:<\/p>\n<pre><code>work(1,1,1,1) = 826\nwork(1,1,1,2) = 935\nwork(1,1,1,3) = 712.5\nwork(1,1,1,4) = 617.1\nwork(1,1,1,5) = 102.2\n<\/code><\/pre>\n<p>But final source file has about 70 megabytes, and 0 chances to compile (compiler out of memory error). Besides, even if it would compile, final DLL have size of ~5MB for each 0.5MB of useful data.<\/p>\n<p>Any ideas to format source in more compact way (compiler optimisation friendly?) or maybe pack data to other structure like string\/raw binary data and extract on runtime ?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need a way to store lot of numerical read-only data (double values) in a DLL. Data must be embedded in source, because it will be changed from time to time &#8211; no external tools like Visual Studio etc., only code generation+shell compiler. I know that it is a bad practice, but this is &#8220;business [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4720","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4720"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4720\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}