diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-21 10:55:09 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-02-21 10:55:09 +0100 |
commit | ccb624e2bb67161590f490f671f611a44fcbd61e (patch) | |
tree | 123f4e25d44b0d1d7888b572720dbb40bada616a /sys/src | |
parent | 6f1787adcb00e8b5d320561b232810a94932b8eb (diff) |
gs: backport 16MB string support
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/cmd/gs/src/ialloc.c | 3 | ||||
-rw-r--r-- | sys/src/cmd/gs/src/igcref.c | 2 | ||||
-rw-r--r-- | sys/src/cmd/gs/src/iref.h | 8 | ||||
-rw-r--r-- | sys/src/cmd/gs/src/zpacked.c | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/sys/src/cmd/gs/src/ialloc.c b/sys/src/cmd/gs/src/ialloc.c index 1b655013a..667ab2ee6 100644 --- a/sys/src/cmd/gs/src/ialloc.c +++ b/sys/src/cmd/gs/src/ialloc.c @@ -161,6 +161,7 @@ gs_alloc_ref_array(gs_ref_memory_t * mem, ref * parr, uint attrs, uint num_refs, client_name_t cname) { ref *obj; + uint i; /* If we're allocating a run of refs already, */ /* and we aren't about to overflow the maximum run length, use it. */ @@ -214,6 +215,8 @@ gs_alloc_ref_array(gs_ref_memory_t * mem, ref * parr, uint attrs, cl.cp->has_refs = true; } } + for (i = 0; i < num_refs; i++) + make_null(&(obj[i])); make_array(parr, attrs | mem->space, num_refs, obj); return 0; } diff --git a/sys/src/cmd/gs/src/igcref.c b/sys/src/cmd/gs/src/igcref.c index 8a203966e..c9e04412f 100644 --- a/sys/src/cmd/gs/src/igcref.c +++ b/sys/src/cmd/gs/src/igcref.c @@ -715,7 +715,7 @@ refs_compact(const gs_memory_t *mem, obj_header_t * pre, obj_header_t * dpre, ui } #endif /* Pad to a multiple of sizeof(ref). */ - while (new_size & (sizeof(ref) - 1)) + while (new_size % sizeof(ref)) *dest++ = pt_tag(pt_integer), new_size += sizeof(ref_packed); /* We want to make the newly freed space into a free block, */ diff --git a/sys/src/cmd/gs/src/iref.h b/sys/src/cmd/gs/src/iref.h index 15316b04d..be98d4a89 100644 --- a/sys/src/cmd/gs/src/iref.h +++ b/sys/src/cmd/gs/src/iref.h @@ -376,7 +376,7 @@ typedef int (*op_proc_t)(i_ctx_t *i_ctx_p); struct tas_s { /* type_attrs is a single element for fast dispatching in the interpreter */ ushort type_attrs; - ushort rsize; + uint rsize; }; struct ref_s { @@ -560,9 +560,7 @@ struct ref_s { (arch_align_ptr_mod - 1)) + 1) /* Define the maximum size of an array or a string. */ -/* The maximum array size is determined by the fact that */ -/* the allocator cannot allocate a block larger than max_uint. */ -#define max_array_size (max_ushort & (max_uint / (uint)arch_sizeof_ref)) -#define max_string_size max_ushort +#define max_array_size (16*1024*1024) +#define max_string_size (16*1024*1024) #endif /* iref_INCLUDED */ diff --git a/sys/src/cmd/gs/src/zpacked.c b/sys/src/cmd/gs/src/zpacked.c index 315025071..e0fcdc80e 100644 --- a/sys/src/cmd/gs/src/zpacked.c +++ b/sys/src/cmd/gs/src/zpacked.c @@ -151,7 +151,7 @@ make_packed_array(ref * parr, ref_stack_t * pstack, uint size, } ishort = idest += packed_per_ref; } - pad = -(int)idest & (packed_per_ref - 1); /* padding at end */ + pad = (packed_per_ref - idest % packed_per_ref) % packed_per_ref; /* padding at end */ /* Now we can allocate the array. */ |