Click here to Skip to main content
15,907,497 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralIf then statement help Pin
Mustanggt29-Nov-02 18:04
Mustanggt29-Nov-02 18:04 
GeneralRe: If then statement help Pin
Nish Nishant29-Nov-02 18:17
sitebuilderNish Nishant29-Nov-02 18:17 
GeneralRe: If then statement help Pin
Christian Graus29-Nov-02 18:42
protectorChristian Graus29-Nov-02 18:42 
GeneralRe: If then statement help Pin
Nish Nishant29-Nov-02 18:49
sitebuilderNish Nishant29-Nov-02 18:49 
GeneralRe: If then statement help Pin
Christian Graus30-Nov-02 10:23
protectorChristian Graus30-Nov-02 10:23 
GeneralSMTP for PocketPC Pin
joji29-Nov-02 16:47
joji29-Nov-02 16:47 
GeneralRe: SMTP for PocketPC Pin
Anders Molin30-Nov-02 8:00
professionalAnders Molin30-Nov-02 8:00 
QuestionPage/byte alignment? Pin
Matt Gullett29-Nov-02 15:19
Matt Gullett29-Nov-02 15:19 
I have a class which manages byte buffers and TCHAR buffers. The class has an Initialize method which is used to allocate a new buffer (or use an existing one of suffecient size) of bytes or TCHARs. The buffer it allocates is always at least as big as the size requested. What I want to do is insure that the buffer allocated is allocated page and byte aligned.

What is the page size for x86 platform? Is it 4K??? Is this the correct way to deal with this?

int CMyBuffer::Initialize(const long lRequestedSize)
{
   int iReturn = NO_ERROR;

   long lAllocSize = (lRequestedSize + (lRequestedSize % 4000));

   .. bla bla bla ...

   return iReturn;
}

AnswerRe: Page/byte alignment? Pin
Mike Nordell29-Nov-02 16:34
Mike Nordell29-Nov-02 16:34 
GeneralRe: Page/byte alignment? Pin
Matt Gullett29-Nov-02 16:41
Matt Gullett29-Nov-02 16:41 
GeneralRe: Page/byte alignment? Pin
Mike Nordell29-Nov-02 20:40
Mike Nordell29-Nov-02 20:40 
AnswerRe: Page/byte alignment? Pin
Michael Dunn29-Nov-02 16:55
sitebuilderMichael Dunn29-Nov-02 16:55 
GeneralRe: Page/byte alignment? Pin
Matt Gullett29-Nov-02 16:57
Matt Gullett29-Nov-02 16:57 
GeneralSending Paste Message Pin
Gilfrog29-Nov-02 14:11
Gilfrog29-Nov-02 14:11 
GeneralRe: Sending Paste Message Pin
Gilfrog30-Nov-02 13:20
Gilfrog30-Nov-02 13:20 
GeneralRandom Numbers Pin
Steven M Hunt29-Nov-02 14:06
Steven M Hunt29-Nov-02 14:06 
GeneralRe: Random Numbers Pin
Nish Nishant29-Nov-02 15:28
sitebuilderNish Nishant29-Nov-02 15:28 
GeneralRe: Random Numbers Pin
Steven M Hunt29-Nov-02 17:34
Steven M Hunt29-Nov-02 17:34 
GeneralRe: Random Numbers Pin
Paul M Watt29-Nov-02 17:39
mentorPaul M Watt29-Nov-02 17:39 
GeneralRe: Random Numbers Pin
Nish Nishant29-Nov-02 18:12
sitebuilderNish Nishant29-Nov-02 18:12 
GeneralRe: Random Numbers Pin
Steven M Hunt29-Nov-02 18:18
Steven M Hunt29-Nov-02 18:18 
GeneralRe: Random Numbers Pin
Nish Nishant29-Nov-02 18:10
sitebuilderNish Nishant29-Nov-02 18:10 
GeneralRe: Random Numbers Pin
Sean_Yang4-Dec-02 19:12
Sean_Yang4-Dec-02 19:12 
GeneralRe: Random Numbers Pin
devvvy29-Nov-02 22:03
devvvy29-Nov-02 22:03 
Generalc++ plotting routine Pin
amica29-Nov-02 13:23
amica29-Nov-02 13:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.