Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesBYTEmark Bug Bitten?


March 1996 / Letters / BYTEmark Bug Bitten?

In regard to "BYTEmark Bug Bashed" (December), it appears to me that the bug is with the compiler vendor's malloc() rather than with your code. The C Standard section on memory management functions states that "the pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to a pointer to any type of object and then used to access such an object or an array of such objects in the space allocated (until the space is explicitly freed or reallocated)." If double requires 8-byte alignment to work properly, and double has the strictest alignment requirements, then malloc() should return memory aligned to at least 8-byte boundaries.

Fred J. Tydeman
Member, X3J11 (ANSI C Committee)
tydeman@tybor.com

You may be rig ht. We have received several letters suggesting that the problem lies with the C library's implementation of malloc() , not with our benchmarks; however, we have not yet found any documentation that explicitly states that a malloc() returning data not optimally aligned is in error. It's not quite accurate to say that "double requires 8-byte alignment to work." The algorithm works even if the data is not aligned. It just works more slowly.--Rick Grehan, senior technical editor


Up to the Letters section contentsGo to previous article: Go to next article: Where's the GNU Hurd?SearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network