Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3c2871e1
Commit
3c2871e1
authored
Feb 03, 1997
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The USE_CACHE_ALIGNING define now has a value: the number of *words*
in a cacheline.
parent
af310c1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
Mac/mwerks/malloc/malloc.c
Mac/mwerks/malloc/malloc.c
+11
-4
No files found.
Mac/mwerks/malloc/malloc.c
View file @
3c2871e1
...
@@ -61,8 +61,6 @@ static char *rcsid = "$Id$";
...
@@ -61,8 +61,6 @@ static char *rcsid = "$Id$";
#define VCHECK
#define VCHECK
#endif
/* USE_MALLOC_DEBUG */
#endif
/* USE_MALLOC_DEBUG */
#define USE_CACHE_ALIGN
/* Define for aligning everything on 16-byte boundaries */
typedef
unsigned
char
u_char
;
typedef
unsigned
char
u_char
;
typedef
unsigned
long
u_long
;
typedef
unsigned
long
u_long
;
typedef
unsigned
int
u_int
;
typedef
unsigned
int
u_int
;
...
@@ -104,9 +102,9 @@ union overhead {
...
@@ -104,9 +102,9 @@ union overhead {
#define ov_index ovu.ovu_index
#define ov_index ovu.ovu_index
#define ov_rmagic ovu.ovu_rmagic
#define ov_rmagic ovu.ovu_rmagic
#define ov_size ovu.ovu_size
#define ov_size ovu.ovu_size
#ifdef USE_CACHE_ALIGN
#ifdef USE_CACHE_ALIGN
ED
struct
cachealigner
{
struct
cachealigner
{
u_long
ovalign
_1
,
ovalign_2
,
ovalign_3
,
ovalign_4
;
u_long
ovalign
[
USE_CACHE_ALIGNED
]
;
};
};
#endif
/* USE_CACHE_ALIGN */
#endif
/* USE_CACHE_ALIGN */
};
};
...
@@ -263,10 +261,19 @@ morecore(bucket)
...
@@ -263,10 +261,19 @@ morecore(bucket)
#ifdef DEBUG2
#ifdef DEBUG2
ASSERT
(
nblks
*
sz
==
amt
);
ASSERT
(
nblks
*
sz
==
amt
);
#endif
#endif
#ifdef USE_CACHE_ALIGNED
op
=
(
union
overhead
*
)
NewPtr
(
amt
+
4
*
USE_CACHE_ALIGNED
);
#else
op
=
(
union
overhead
*
)
NewPtr
(
amt
);
op
=
(
union
overhead
*
)
NewPtr
(
amt
);
#endif
/* no more room! */
/* no more room! */
if
(
op
==
NULL
)
if
(
op
==
NULL
)
return
;
return
;
#ifdef USE_CACHE_ALIGNED
#define ALIGN_MASK (4*USE_CACHE_ALIGNED-1)
while
((
long
)
op
&
ALIGN_MASK
)
op
=
(
union
overhead
*
)((
long
)
op
+
1
);
#endif
/* USE_CACHE_ALIGNED */
/*
/*
* Add new memory allocated to that on
* Add new memory allocated to that on
* free list for this hash bucket.
* free list for this hash bucket.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment