[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Tsp-devel] Alignment error on VxWorks

From: TSP
Subject: RE: [Tsp-devel] Alignment error on VxWorks
Date: Thu, 27 Nov 2008 17:05:51 +0100

Hi all Freds and others

De : address@hidden [mailto:address@hidden De la part de Frédéric Martinsons
Envoyé : jeudi 27 novembre 2008 16:35
À : Transport Sample Protocol development list
Objet : Re: [Tsp-devel] Alignment error on VxWorks

OK thanks for answering so fast Stephane and Fred (nice name by the way).

Stop me if I'm wrong : BB is a big shared malloc and when we call bb_publish,data is written "manually" into it and return the address of the first byte ?

I've checked this issue on vxworks and it appears there is a function (memalign ) which forces the allocated buffer to starts on a memory adress evenly divisible by a parameter ( power of 2 ).I could use it instead of a simple malloc.

If what I said above is what is done in BB (write manually the data in the "malloced" shmem), I don't think there is any chance to work, right ?

I think I will try to modify bb_publish to handle alignment issue but everything I see to solve this is "to fill the blank".I mean add an offset in order to make the following addresses begin at the right value (e.g divisible by 4).Ot course, it leads to a waste of memory.There is an other method ? 
As far as I am concern, I don't think that manually forcing align on 4 or 8 bytes in bb_publish won't be a big waste.
It will only happens when U2 are followed U64, and will charge memory of 16 bytes instead of 10 bytes. So the worst case (U2 => U64) *n would only takes 60% more than the minimum.
And I think it will be much more faster than any copy byte per byte, and I'm not even sure that you can  implement it with BB concept
(Pointers returns by bb_publish are like pointers from malloc, and users can play with them as they want)
But if you implement that kind of strict align in BB, please keep it configurable from 1 to 8 bytes.
Ce courriel (incluant ses eventuelles pieces jointes) peut contenir des informations confidentielles et/ou protegees ou dont la diffusion est restreinte. Si vous avez recu ce courriel par erreur, vous ne devez ni le copier, ni l'utiliser, ni en divulguer le contenu a quiconque. Merci d'en avertir immediatement l'expediteur et d'effacer ce courriel de votre systeme. Astrium decline toute responsabilite en cas de corruption par virus, d'alteration ou de falsification de ce courriel lors de sa transmission par voie electronique.
This email (including any attachments) may contain confidential and/or privileged information or information otherwise protected from disclosure. If you are not the intended recipient, please notify the sender immediately, do not copy this message or any attachments and do not use it for any purpose or disclose its content to any person, but delete this message and any attachments from your system. Astrium disclaims any and all liability if this email transmission was virus corrupted, altered or falsified. 
Astrium SAS (393 341 516 RCS Paris) - Siege social: 6 rue Laurent Pichat, 75016 Paris, France

reply via email to

[Prev in Thread] Current Thread [Next in Thread]