<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 7/30/2018 1:57 AM, Christian Böhme
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:611e2deb-2513-97da-98b2-6bbf8a8f90fd@cloudandheat.com">What's
      the reason for using malloc(3) in the first place? Is this a
      limitation of the library or just openssl cms ?
      <p wrap="">
        For the latter, if the argument to -in can be determined to
        resolve to a file descriptor of a regular file, the file's
        contents can be /very/ conveniently mmap(2)'ed into the process'
        address space, ignoring possible limits.<br>
      </p>
    </blockquote>
    <p>If you can't malloc the space, you probably can't mmap it
      either.  I have never heard of a malloc implementation that has
      artificial limits; if it's failing it's because it can't find that
      much contiguous virtual address space, and mmap won't be able to
      find it either.<br>
    </p>
    <p>If you're a 32-bit process, then malloc'ing or mmap'ing a 2GB
      object will be difficult at best.</p>
    <pre class="moz-signature" cols="72">-- 
Jordan Brown, Oracle Solaris</pre>
  </body>
</html>