Align shared_mem and initial jikes buffer
This commit is contained in:
parent
c9323cd901
commit
6b9777cb9b
|
@ -38,8 +38,7 @@ int init_thread_comm(struct thread_comm *comm)
|
|||
{
|
||||
void **new_buffer;
|
||||
|
||||
new_buffer = (void **) malloc(BUFFER_SIZE);
|
||||
if (new_buffer == NULL)
|
||||
if (posix_memalign((void *) &new_buffer, CACHE_LINE_SIZE, BUFFER_SIZE))
|
||||
{
|
||||
fprintf(stderr, "Failed to allocate a new buffer for the thread\n");
|
||||
return -1;
|
||||
|
|
|
@ -15,8 +15,7 @@ __thread volatile int prod_idx = 0;
|
|||
|
||||
int init_thread_comm(struct thread_comm *comm)
|
||||
{
|
||||
shared_space = (volatile void **) malloc(SHARED_SPACE_SIZE);
|
||||
if (shared_space == NULL)
|
||||
if (posix_memalign((void *) &shared_space, CACHE_LINE_SIZE, SHARED_SPACE_SIZE))
|
||||
{
|
||||
fprintf(stderr, "Unable to allocate space for shared mem communication\n");
|
||||
return -1;
|
||||
|
|
|
@ -15,8 +15,7 @@ __thread volatile int prod_idx = 0;
|
|||
|
||||
int init_thread_comm(struct thread_comm *comm)
|
||||
{
|
||||
shared_space = (volatile void **) malloc(SHARED_SPACE_SIZE);
|
||||
if (shared_space == NULL)
|
||||
if (posix_memalign((void *) &shared_space, CACHE_LINE_SIZE, SHARED_SPACE_SIZE))
|
||||
{
|
||||
fprintf(stderr, "Unable to allocate space for shared mem communication\n");
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue