[curl-loader-devel] Memory pool - objects alignment proposal
Status: Alpha
Brought to you by:
coroberti
From: Robert I. <cor...@gm...> - 2007-04-20 08:01:48
|
On 4/19/07, Michael Moser <mos...@gm...> wrote: > don't know about AMD_64 and pointer alignment, however; do you > remember? what is Intel_64 doing?? Intel recommends to align a pointer on 64-bit at 8 byte boundary. Please, look here: www.intel.com/cd/ids/developer/asmo-na/eng/328769.htm > On 4/19/07, Michael Moser <mos...@gm...> wrote: > > mpool implementation does not align the pooled object size - therefore > > the pointer returned by the beast will not be four byte aligned (on > > Intel this is not good - will create misalignment interrupts when > > using the data). > > > > fix: > > > > #define PTR_ALIGN 4 > > > > int mpool_init (mpool* mpool, size_t object_size, int num_obj) > > { > > object_size = (object_size + PTR_ALIGN) & ( ~ (PTR_ALIGN - 1) ); > > .... > > if we have x86_64 or amd64 - check which flags exactly - 8 bytes, else -4 bytes. But I do not have a 64 bit linux now, therefore the question is how to test. Do you have something 64 bit with linux? -- Sincerely, Robert Iakobashvili, coroberti %x40 gmail %x2e com ................................................................... Navigare necesse est, vivere non est necesse ................................................................... http://curl-loader.sourceforge.net An open-source HTTP/S, FTP/S traffic generating, and web testing tool. |