#1731: Assumption made about buffer header alignment
-------------------------------------+--------------------------------------
Reporter: Paul C. Anagnostopoulos | Owner: Paul C. Anagnostopoulos
Type: bug | Status: assigned
Priority: normal | Milestone:
Component: core | Version: 2.6.0
Severity: low | Keywords:
Lang: | Patch:
Platform: |
-------------------------------------+--------------------------------------
Comment(by Paul C. Anagnostopoulos):
Sorry, confusing terminology. The buffer "header" is the information
stored in front of the actual buffer memory. The Buffer object is the
buffer "descriptor." Here's the new description from pobj.h:
{{{
/* A buffer descriptor object points to a buffer in a Memory_Block.
The buffer includes a header, but _bufstart points to the data
portion. Here is how it works:
Buffer descriptor buffer
+-------------------+ +------------------------+
| flags | | (possible padding) | }
+-------------------+ +---------------------+--+ >
header
| _bufstart | ------+ | *Memory_Block |fl| }
+-------------------+ | +---------------------+--+
| _buflen | +-------> | data portion |
+-------------------+ | |
~ ~
| |
+------------------------+
The buffer header consists of possible padding and a pointer to the
Memory_Block containing the buffer. There are two flags in the low-
order
bits of the pointer (see string.h). Padding is only required if the
alignment of the data portion is higher than that of a pointer.
This was not the case as of 8/2010.
*/
}}}
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1731#comment:3>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets