mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- The data structure alignment (file I/O buffer) is now configurable
at compile time. The default used to be 16 bytes, which is appropriate for the 68040/68060 but not for the PowerPC, which uses 32 or 128 bytes per cache line. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14787 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_init_exit.c,v 1.3 2004-12-26 10:28:56 obarthel Exp $
|
||||
* $Id: stdio_init_exit.c,v 1.4 2004-12-26 13:14:47 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -176,12 +176,12 @@ __stdio_init(void)
|
||||
PROFILE_ON();
|
||||
|
||||
/* Allocate a little more memory than necessary. */
|
||||
buffer = malloc(BUFSIZ + 15);
|
||||
buffer = malloc(BUFSIZ + (CACHE_LINE_SIZE-1));
|
||||
if(buffer == NULL)
|
||||
goto out;
|
||||
|
||||
/* Align the buffer start address to a cache line boundary. */
|
||||
aligned_buffer = (char *)((ULONG)(buffer + 15) & ~15UL);
|
||||
aligned_buffer = (char *)((ULONG)(buffer + (CACHE_LINE_SIZE-1)) & ~(CACHE_LINE_SIZE-1));
|
||||
|
||||
__initialize_fd(__fd[i],(HOOKFUNC)__fd_hook_entry,default_file,fd_flags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user