[llvm-commits] CVS: llvm/include/llvm/System/Memory.h

Reid Spencer reid at x10sys.com
Fri Jul 29 19:04:24 PDT 2005


On Fri, 2005-07-29 at 18:38 -0500, Andrew Lenharth wrote:
> 

> support near allocations for the JIT
>        /// This method allocates a block of Read/Write/Execute memory that is
>        /// suitable for executing dynamically generated code (e.g. JIT). An
>        /// attempt to allocate \p NumBytes bytes of virtual memory is made.
> +      /// \p NearBlock may point to an existing allocation in which case
> +      /// an attempt is made to allocate more memory near the existing block.
>        /// @throws std::string if an error occurred.
>        /// @brief Allocate Read/Write/Execute memory.
> -      static MemoryBlock AllocateRWX(unsigned NumBytes);
> +      static MemoryBlock AllocateRWX(unsigned NumBytes, const MemoryBlock* NearBlock);

What if one does NOT want to allocate something near another block?
Shouldn't the second argument be initialized to zero in order to retain
the existing API? A zero value would indicate that the "NearBlock"
constraint should be ignored and the function is permitted to allocate
memory anywhere available. Furthermore, this needs to be "hint" as is
done with the mmap(2) system call.

Reid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20050729/6d8a7af5/attachment.sig>


More information about the llvm-commits mailing list