* src/mm/memory.c: Likewise.
* src/vm/jit/dseg.c: Likewise.
* src/vm/jit/parse.c: Likewise.
* src/vm/jit/codegen-common.c: Likewise.
* src/vm/linker.c: Likewise.
* src/mm/nogc.c: Likewise.
* src/cacaoh/headers.c: Likewise.
Christian Thalinger
Edwin Steiner
- $Id: headers.c 5854 2006-10-29 11:15:36Z edwin $
+ $Id: headers.c 5868 2006-10-30 11:21:36Z edwin $
*/
u4 newsize,i;
if (!dopadding) return;
- newsize = ALIGN(outputsize, len);
+ newsize = MEMORY_ALIGN(outputsize, len);
for (i = outputsize; i < newsize; i++) fprintf(file, " u1 pad%d\n", (int) i);
outputsize = newsize;
Changes: Christian Thalinger
Edwin Steiner
- $Id: memory.c 5807 2006-10-20 00:37:37Z ajordan $
+ $Id: memory.c 5868 2006-10-30 11:21:36Z edwin $
*/
LOCK_MONITOR_ENTER(lock_code_memory);
- size = ALIGN(size, ALIGNSIZE);
+ size = MEMORY_ALIGN(size, ALIGNSIZE);
/* check if enough memory is available */
/* align the size of the memory to be allocated */
- code_memory_size = ALIGN(code_memory_size, pagesize);
+ code_memory_size = MEMORY_ALIGN(code_memory_size, pagesize);
#if defined(ENABLE_STATISTICS)
if (opt_stat) {
if (size == 0)
return NULL;
- size = ALIGN(size, ALIGNSIZE);
+ size = MEMORY_ALIGN(size, ALIGNSIZE);
if (di->useddumpsize + size > di->allocateddumpsize) {
dumpblock_t *newdumpblock;
Changes: Christian Thalinger
- $Id: memory.h 5803 2006-10-19 09:25:41Z twisti $
+ $Id: memory.h 5868 2006-10-30 11:21:36Z edwin $
*/
Some more macros:
- ALIGN (pos, size) ... make pos divisible by size. always returns an
- address >= pos.
+ MEMORY_ALIGN (pos, size) ... make pos divisible by size. always returns an
+ address >= pos.
OFFSET (s,el) ....... returns the offset of 'el' in structure 's' in bytes.
*/
-#define ALIGN(pos,size) ((((pos) + (size) - 1) / (size)) * (size))
-#define PADDING(pos,size) (ALIGN((pos),(size)) - (pos))
+#define MEMORY_ALIGN(pos,size) ((((pos) + (size) - 1) / (size)) * (size))
+#define PADDING(pos,size) (MEMORY_ALIGN((pos),(size)) - (pos))
#define OFFSET(s,el) ((s4) ((ptrint) &(((s*) 0)->el)))
#if !defined(DISABLE_GC)
Changes:
- $Id: nogc.c 4437 2006-02-05 00:13:21Z twisti $
+ $Id: nogc.c 5868 2006-10-30 11:21:36Z edwin $
*/
{
void *m;
- mmapptr = (void *) ALIGN((ptrint) mmapptr, ALIGNSIZE);
+ mmapptr = (void *) MEMORY_ALIGN((ptrint) mmapptr, ALIGNSIZE);
m = mmapptr;
mmapptr = (void *) ((ptrint) mmapptr + size);
void nogc_init(u4 heapmaxsize, u4 heapstartsize)
{
- heapmaxsize = ALIGN(heapmaxsize, ALIGNSIZE);
+ heapmaxsize = MEMORY_ALIGN(heapmaxsize, ALIGNSIZE);
mmapptr = mmap((void *) MMAP_HEAPADDRESS,
(size_t) heapmaxsize,
memory. All functions writing values into the data area return the offset
relative the begin of the code area (start of procedure).
- $Id: codegen-common.c 5842 2006-10-27 10:41:02Z twisti $
+ $Id: codegen-common.c 5868 2006-10-30 11:21:36Z edwin $
*/
}
#endif
- alignedmcodelen = ALIGN(mcodelen, MAX_ALIGN);
+ alignedmcodelen = MEMORY_ALIGN(mcodelen, MAX_ALIGN);
#if defined(ENABLE_INTRP)
if (opt_intrp)
}
#endif
- cd->dseglen = ALIGN(cd->dseglen, MAX_ALIGN);
+ cd->dseglen = MEMORY_ALIGN(cd->dseglen, MAX_ALIGN);
alignedlen = alignedmcodelen + cd->dseglen;
#if defined(ENABLE_INTRP)
Joseph Wenninger
Edwin Steiner
- $Id: dseg.c 5852 2006-10-28 19:26:51Z twisti $
+ $Id: dseg.c 5868 2006-10-30 11:21:36Z edwin $
*/
/* Increase data segment size, which is also the displacement into
the data segment. */
- cd->dseglen = ALIGN(cd->dseglen + 8, 8);
+ cd->dseglen = MEMORY_ALIGN(cd->dseglen + 8, 8);
/* allocate new entry */
/* Increase data segment size, which is also the displacement into
the data segment. */
- cd->dseglen = ALIGN(cd->dseglen + 8, 8);
+ cd->dseglen = MEMORY_ALIGN(cd->dseglen + 8, 8);
/* allocate new entry */
the data segment. */
#if SIZEOF_VOID_P == 8
- cd->dseglen = ALIGN(cd->dseglen + 8, 8);
+ cd->dseglen = MEMORY_ALIGN(cd->dseglen + 8, 8);
#else
cd->dseglen += 4;
#endif
Joseph Wenninger
Christian Thalinger
- $Id: parse.c 5866 2006-10-30 11:00:56Z edwin $
+ $Id: parse.c 5868 2006-10-30 11:21:36Z edwin $
*/
s4 prevvalue = 0;
#endif
blockend = true;
- nextp = ALIGN((p + 1), 4);
+ nextp = MEMORY_ALIGN((p + 1), 4);
CHECK_END_OF_BYTECODE(nextp + 8);
branch_target_t *table;
blockend = true;
- nextp = ALIGN((p + 1), 4);
+ nextp = MEMORY_ALIGN((p + 1), 4);
CHECK_END_OF_BYTECODE(nextp + 12);
Edwin Steiner
Christian Thalinger
- $Id: linker.c 5813 2006-10-20 14:26:50Z twisti $
+ $Id: linker.c 5868 2006-10-30 11:21:36Z edwin $
*/
/* header structs like java_lang_Double must match the offsets */
/* of the Java fields (eg. java.lang.Double.value). */
#if defined(__I386__)
- c->instancesize = ALIGN(c->instancesize, 4);
+ c->instancesize = MEMORY_ALIGN(c->instancesize, 4);
#else
- c->instancesize = ALIGN(c->instancesize, dsize);
+ c->instancesize = MEMORY_ALIGN(c->instancesize, dsize);
#endif
f->offset = c->instancesize;