Check-in [b853c133f7]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Force objects to be allocated to at least the base size.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b853c133f722f5cecd86a1168d88c57587701d64
User & Date: stephanie.gawroriski 2019-12-01 15:46:50
Context
2019-12-01
15:47
Correct compilation error. check-in: a20e27f03e user: stephanie.gawroriski tags: trunk
15:46
Force objects to be allocated to at least the base size. check-in: b853c133f7 user: stephanie.gawroriski tags: trunk
15:44
Add methods to help for the allocation of objects and arrays. check-in: 8f2394f21a user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/klib/supervisor/cc/squirreljme/jvm/task/TaskAllocator.java.

96
97
98
99
100
101
102


103
104
105

106






107
108
109
110
111
112
113
	}
	
	/**
	 * Allocates an object type.
	 *
	 * @param __sz The size of the object.
	 * @return The allocated bytes.


	 * @since 2019/10/26
	 */
	public final int allocateObject(int __sz)

	{






		int rv = this.allocate(Allocator.CHUNK_BIT_IS_OBJECT, __sz);
		
		// Set initial count to one, to match new
		Assembly.memWriteInt(rv, Constants.OBJECT_COUNT_OFFSET,
			1);
		
		return rv;







>
>



>

>
>
>
>
>
>







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
	}
	
	/**
	 * Allocates an object type.
	 *
	 * @param __sz The size of the object.
	 * @return The allocated bytes.
	 * @throws IllegalArgumentException If the allocation size is smaller
	 * than the object base size.
	 * @since 2019/10/26
	 */
	public final int allocateObject(int __sz)
		throws IllegalArgumentException
	{
		// {@squirreljme.error SV0x Object allocation is less than the object
		// base size.}
		if (__sz < OBJECT_BASE_SIZE)
			throw new IllegalArgumentException("SV0x");
		
		// Allocate
		int rv = this.allocate(Allocator.CHUNK_BIT_IS_OBJECT, __sz);
		
		// Set initial count to one, to match new
		Assembly.memWriteInt(rv, Constants.OBJECT_COUNT_OFFSET,
			1);
		
		return rv;