Author vstinner
Recipients njs, pitrou, vstinner
Date 2016-03-18.10:49:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMpsgwaSVMr19sQx_BXHbwM3reK_rkhCWUfqQZQ=ww8v+wxuTQ@mail.gmail.com>
In-reply-to <1458297338.01.0.0450328155143.issue26530@psf.upfronthosting.co.za>
Content
If you consider that using least signifiant bits to store an
identifier of the address space is a bad idea, I'm open to discuss how
tracemalloc should be extended to support this use case.

--

malloc in POSIX standard:
http://pubs.opengroup.org/onlinepubs/009695399/functions/malloc.html
"The pointer returned if the allocation succeeds shall be suitably
aligned so that it may be assigned to a pointer to any type of object
and then used to access such an object in the space allocated (until
the space is explicitly freed or reallocated)."

Linux manual page has a simpler definition: "The malloc() and calloc()
functions return a pointer to the allocated memory, which is suitably
aligned for any built-in type."

malloc of the GNU libc:
"The address of a block returned by malloc or realloc in GNU systems
is always a multiple of eight (or sixteen on 64-bit systems)."
http://www.gnu.org/software/libc/manual/html_node/Aligned-Memory-Blocks.html

Random Google link for GPU:

"cudaMalloc() returns memory which is aligned at 256 bytes." (8 bits)
http://www.dmi.unict.it/~bilotta/gpgpu/notes/09-optimization.html

"Minimum alignment (bytes) for any datatype:    128"
http://unix.stackexchange.com/questions/187245/how-to-get-the-size-of-gpu-memory-available-for-opencl
History
Date User Action Args
2016-03-18 10:49:39vstinnersetrecipients: + vstinner, pitrou, njs
2016-03-18 10:49:39vstinnerlinkissue26530 messages
2016-03-18 10:49:37vstinnercreate