Skip to content
Browse files

Don't use mem_sys_* macros. They are deprecated

  • Loading branch information...
1 parent 6444a67 commit 8213cff80b3f1f5528ccf338be7c6a0ea61d8c1a @bacek bacek committed Mar 5, 2012
View
6 src/dynpmc/gziphandle.pmc
@@ -204,7 +204,7 @@ Read the given number of bytes from the gziphandle and return them in a string.
int result;
gzFile file;
STRING *str = STRINGNULL;
- char * const buf = mem_allocate_n_zeroed_typed(length, char);
+ char * const buf = mem_internal_allocate_n_zeroed_typed(length, char);
GET_ATTR_file(INTERP, SELF, file);
result = gzread(file, buf, length);
if (result > 0) {
@@ -251,7 +251,7 @@ Returns a string with the zlib version.
srcLen = Parrot_str_byte_length(INTERP, str);
dstLen = 12 + srcLen + srcLen / 1000;
- buf = mem_allocate_n_zeroed_typed(dstLen, char);
+ buf = mem_internal_allocate_n_zeroed_typed(dstLen, char);
if (!buf) {
Parrot_str_free_cstring(src);
@@ -303,7 +303,7 @@ Returns a string with the zlib version.
srcLen = Parrot_str_byte_length(INTERP, str);
dstLen = 2 * srcLen;
REDO:
- buf = mem_allocate_n_zeroed_typed(dstLen, char);
+ buf = mem_internal_allocate_n_zeroed_typed(dstLen, char);
if (!buf) {
Parrot_str_free_cstring(src);
View
2 src/gc/gc_gms.c
@@ -722,7 +722,7 @@ Parrot_gc_gms_init(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args))
else {
size_t i;
- self = mem_allocate_zeroed_typed(MarkSweep_GC);
+ self = mem_internal_allocate_zeroed_typed(MarkSweep_GC);
self->pmc_allocator = Parrot_gc_pool_new(interp,
sizeof (pmc_alloc_struct));
View
2 src/gc/gc_ms2.c
@@ -632,7 +632,7 @@ Parrot_gc_ms2_init(PARROT_INTERP, ARGIN(Parrot_GC_Init_Args *args))
self = (MarkSweep_GC*)interp->parent_interpreter->gc_sys->gc_private;
}
else {
- self = mem_allocate_zeroed_typed(MarkSweep_GC);
+ self = mem_internal_allocate_zeroed_typed(MarkSweep_GC);
self->pmc_allocator = Parrot_gc_pool_new(interp,
sizeof (pmc_alloc_struct));
View
4 src/hash.c
@@ -876,9 +876,9 @@ expand_hash(PARROT_INTERP, ARGMOD(Hash *hash))
new_index = (HashBucket **)(new_buckets + N_BUCKETS(new_size));
/* copy buckets and index */
- mem_sys_memcopy(new_buckets, hash->buckets,
+ memcpy(new_buckets, hash->buckets,
N_BUCKETS(old_size) * sizeof (HashBucket));
- mem_sys_memcopy(new_index, hash->index, old_size * sizeof (HashBucket *));
+ memcpy(new_index, hash->index, old_size * sizeof (HashBucket *));
/* free */
if (old_size > SPLIT_POINT)
View
4 src/packfile/api.c
@@ -387,7 +387,7 @@ Parrot_pf_tag_constant(PARROT_INTERP, ARGIN(PackFile_ConstTable *ct),
}
}
- mem_sys_memmove(&ct->tag_map[cur + 1], &ct->tag_map[cur],
+ memmove(&ct->tag_map[cur + 1], &ct->tag_map[cur],
((ct->ntags - 1) - cur) * sizeof (PackFile_ConstTagPair));
ct->tag_map[cur].tag_idx = tag_idx;
ct->tag_map[cur].const_idx = const_idx;
@@ -1879,7 +1879,7 @@ PackFile_Annotations_add_entry(PARROT_INTERP, ARGMOD(PackFile_Annotations *self)
/* Extend segment data and shift subsequent data by 2. */
self->base.data = (opcode_t *)mem_sys_realloc(self->base.data,
(self->base.size + 2) * sizeof (opcode_t));
- mem_sys_memmove(&self->base.data[idx + 2], &self->base.data[idx],
+ memmove(&self->base.data[idx + 2], &self->base.data[idx],
(self->base.size - idx) * sizeof (opcode_t));
self->base.size += 2;
for (i = key_id + 1; i < self->num_keys; i++)
View
4 src/packfile/output.c
@@ -118,12 +118,12 @@ PackFile_pack(PARROT_INTERP, ARGMOD(PackFile *self), ARGOUT(opcode_t *cursor))
self->src = cursor;
/* Pack the fixed part of the header */
- mem_sys_memcopy(cursor, self->header, PACKFILE_HEADER_BYTES);
+ memcpy(cursor, self->header, PACKFILE_HEADER_BYTES);
byte_cursor += PACKFILE_HEADER_BYTES;
/* Pack the UUID. */
if (self->header->uuid_size > 0)
- mem_sys_memcopy(byte_cursor, self->header->uuid_data,
+ memcpy(byte_cursor, self->header->uuid_data,
self->header->uuid_size);
/* Padding. */
View
6 src/packfile/pf_items.c
@@ -1143,7 +1143,7 @@ PF_store_number(ARGOUT(opcode_t *cursor), ARGIN(const FLOATVAL *val))
ASSERT_ARGS(PF_store_number)
opcode_t padded_size = (sizeof (FLOATVAL) + sizeof (opcode_t) - 1) /
sizeof (opcode_t);
- mem_sys_memcopy(cursor, val, sizeof (FLOATVAL));
+ memcpy(cursor, val, sizeof (FLOATVAL));
cursor += padded_size;
return cursor;
}
@@ -1230,7 +1230,7 @@ PF_store_buf(ARGOUT(opcode_t *cursor), ARGIN(const STRING *s))
if (s->strstart) {
char *charcursor = (char *) cursor;
- mem_sys_memcopy(charcursor, s->strstart, s->bufused);
+ memcpy(charcursor, s->strstart, s->bufused);
charcursor += s->bufused;
/* Pad up to wordsize boundary. */
@@ -1376,7 +1376,7 @@ PF_store_string(ARGOUT(opcode_t *cursor), ARGIN(const STRING *s))
charcursor = (char *)cursor;
if (s->strstart) {
- mem_sys_memcopy(charcursor, s->strstart, s->bufused);
+ memcpy(charcursor, s->strstart, s->bufused);
charcursor += s->bufused;
/* Pad up to sizeof (opcode_t) boundary. */
while ((unsigned long) (charcursor - (char *) cursor) % sizeof (opcode_t)) {
View
2 src/packfile/segments.c
@@ -791,7 +791,7 @@ default_unpack(PARROT_INTERP, ARGMOD(PackFile_Segment *self), ARGIN(const opcode
}
if (!self->pf->need_endianize && !self->pf->need_wordsize) {
- mem_sys_memcopy(self->data, cursor, self->size * sizeof (opcode_t));
+ memcpy(self->data, cursor, self->size * sizeof (opcode_t));
cursor += self->size;
}
else {
View
2 src/pmc/fixedbooleanarray.pmc
@@ -143,7 +143,7 @@ Creates and returns a copy of the array.
SET_ATTR_resize_threshold(INTERP, dest, resize_threshold);
clone_bit_array = mem_gc_allocate_n_typed(INTERP, size_in_bytes, unsigned char);
- mem_sys_memcopy(clone_bit_array, my_bit_array, size_in_bytes);
+ memcpy(clone_bit_array, my_bit_array, size_in_bytes);
SET_ATTR_bit_array(INTERP, dest, clone_bit_array);
}
View
2 src/pmc/fixedstringarray.pmc
@@ -101,7 +101,7 @@ Creates and returns a copy of the array.
mem_size = size * sizeof (STRING *);
dest_str_array = mem_gc_allocate_n_zeroed_typed(INTERP, size, STRING *);
- mem_sys_memcopy(dest_str_array, my_str_array, mem_size);
+ memcpy(dest_str_array, my_str_array, mem_size);
SET_ATTR_str_array(INTERP, dest, dest_str_array);
SET_ATTR_size(INTERP, dest, size);
View
2 src/pmc/imageiofreeze.pmc
@@ -518,7 +518,7 @@ Sets the constant table of this ImageIO PMC.
PObj_custom_destroy_SET(SELF);
ensure_buffer_size(INTERP, SELF, header_length);
- mem_sys_memcopy(GET_VISIT_CURSOR(SELF),
+ memcpy(GET_VISIT_CURSOR(SELF),
PARROT_IMAGEIOFREEZE(SELF)->pf->header, PACKFILE_HEADER_BYTES);
INC_VISIT_CURSOR(SELF, header_length);
}
View
8 src/pmc/resizablebooleanarray.pmc
@@ -168,7 +168,7 @@ Resizes the array to C<size> elements.
/* Replace old array with new array, and free old array */
SET_ATTR_bit_array(INTERP, SELF,
- (unsigned char *)mem_sys_memmove(
+ (unsigned char *)memmove(
new_store, old_store, copy_size));
mem_gc_free(INTERP, old_store);
}
@@ -260,7 +260,7 @@ beginning.
/* Copy contents of old array to new array, moving the head
* position forward by one allocation unit (in bytes). */
old_mem_size = ROUND_BYTES(tail_pos);
- mem_sys_memmove(new_bit_array + (BITS_TO_BYTES(MIN_ALLOC)),
+ memmove(new_bit_array + (BITS_TO_BYTES(MIN_ALLOC)),
old_bit_array, old_mem_size);
/* Replace old array with new array, and free old array */
@@ -321,7 +321,7 @@ Removes and returns the first element.
/* Copy contents of old array to new array, move the head position
* offset back by one allocation unit (in bytes) */
GET_ATTR_bit_array(INTERP, SELF, old_bit_array);
- mem_sys_memmove(new_bit_array, old_bit_array + (BITS_TO_BYTES(MIN_ALLOC)),
+ memmove(new_bit_array, old_bit_array + (BITS_TO_BYTES(MIN_ALLOC)),
new_mem_size);
/* Replace old array with new array, and free old array */
@@ -392,7 +392,7 @@ Returns a copy of the array.
if (my_bit_array) {
const size_t size_in_bits = tail_pos / BITS_PER_CHAR + 1;
dest_bit_array = (unsigned char *)Parrot_gc_allocate_memory_chunk(INTERP, size_in_bits);
- mem_sys_memcopy(dest_bit_array, my_bit_array, size_in_bits);
+ memcpy(dest_bit_array, my_bit_array, size_in_bits);
}
else
dest_bit_array = NULL;
View
4 src/pmc/resizablefloatarray.pmc
@@ -222,7 +222,7 @@ Removes and returns an item from the start of the array.
value = float_array[0];
SET_ATTR_size(INTERP, SELF, --size);
- mem_sys_memmove(float_array, float_array + 1, size * sizeof (FLOATVAL));
+ memmove(float_array, float_array + 1, size * sizeof (FLOATVAL));
return value;
}
@@ -243,7 +243,7 @@ Add and integer to the start of the array.
GET_ATTR_size(INTERP, SELF, size);
SELF.set_integer_native(size + 1);
GET_ATTR_float_array(INTERP, SELF, float_array);
- mem_sys_memmove(float_array + 1, float_array, size * sizeof (FLOATVAL));
+ memmove(float_array + 1, float_array, size * sizeof (FLOATVAL));
float_array[0] = value;
}
View
6 src/pmc/resizableintegerarray.pmc
@@ -224,7 +224,7 @@ Removes and returns an item from the start of the array.
value = int_array[0];
--size;
- mem_sys_memmove(int_array, int_array + 1, size * sizeof (INTVAL));
+ memmove(int_array, int_array + 1, size * sizeof (INTVAL));
SELF.set_integer_native(size);
return value;
}
@@ -245,7 +245,7 @@ Add an integer to the start of the array.
SELF.set_integer_native(size + 1);
GET_ATTR_int_array(INTERP, SELF, int_array);
- mem_sys_memmove(int_array + 1, int_array, size * sizeof (INTVAL));
+ memmove(int_array + 1, int_array, size * sizeof (INTVAL));
int_array[0] = value;
}
@@ -270,7 +270,7 @@ Removes the element at C<key>.
INTVAL *int_array;
GET_ATTR_int_array(INTERP, SELF, int_array);
--size;
- mem_sys_memmove(int_array + key, int_array + key + 1, (size - key) * sizeof (INTVAL));
+ memmove(int_array + key, int_array + key + 1, (size - key) * sizeof (INTVAL));
SELF.set_integer_native(size);
}
}
View
8 src/pmc/resizablepmcarray.pmc
@@ -66,7 +66,7 @@ do_shift(ARGIN(PMC *arr))
PMC ** const item = PMC_array(arr);
PMC_size(arr) = --size;
- mem_sys_memmove(item, item + 1, size * sizeof (PMC *));
+ memmove(item, item + 1, size * sizeof (PMC *));
item[size] = PMCNULL;
}
@@ -80,7 +80,7 @@ do_unshift(PARROT_INTERP, ARGIN(PMC *arr), ARGIN(PMC *val))
VTABLE_set_integer_native(interp, arr, size + 1);
item = PMC_array(arr);
- mem_sys_memmove(item + 1, item, size * sizeof (PMC *));
+ memmove(item + 1, item, size * sizeof (PMC *));
item[0] = val;
}
@@ -670,7 +670,7 @@ Note that the C<from> PMC can be of any of the various array types.
item = PMC_array(SELF);
if (tail > 0 && count > elems1) {
/* we're shrinking the array, so first move the tail left */
- mem_sys_memmove(item + offset + elems1, item + offset + count,
+ memmove(item + offset + elems1, item + offset + count,
tail * sizeof (PMC *));
}
@@ -680,7 +680,7 @@ Note that the C<from> PMC can be of any of the various array types.
item = PMC_array(SELF);
if (tail > 0 && count < elems1) {
/* the array grew, so move the tail to the right */
- mem_sys_memmove(item + offset + elems1, item + offset + count,
+ memmove(item + offset + elems1, item + offset + count,
tail * sizeof (PMC *));
}
View
6 src/pmc/stringbuilder.pmc
@@ -198,7 +198,7 @@ Append string to current buffer.
buffer->bufused = new_buffer->bufused;
buffer->encoding = new_buffer->encoding;
- mem_sys_memcopy(buffer->strstart, new_buffer->strstart,
+ memcpy(buffer->strstart, new_buffer->strstart,
new_buffer->bufused);
}
}
@@ -216,7 +216,7 @@ Append string to current buffer.
}
/* Tack s on the end of buffer */
- mem_sys_memcopy((void *)((ptrcast_t)buffer->_bufstart + buffer->bufused),
+ memcpy((void *)((ptrcast_t)buffer->_bufstart + buffer->bufused),
s->strstart, s->bufused);
/* Update buffer */
@@ -278,7 +278,7 @@ Set content of buffer to passed string or PMC
}
/* Tack s on the buffer */
- mem_sys_memcopy((void *)((char*)buffer->_bufstart),
+ memcpy((void *)((char*)buffer->_bufstart),
s->strstart, s->bufused);
/* Update buffer */
View
2 src/pmc/unmanagedstruct.pmc
@@ -855,7 +855,7 @@ Return a clone of this PMC.
VTABLE PMC *clone() {
PMC * const clone = Parrot_pmc_new(INTERP, enum_class_UnManagedStruct);
- mem_sys_memmove(PMC_data(clone), PMC_data(SELF),
+ memmove(PMC_data(clone), PMC_data(SELF),
sizeof (Parrot_UnManagedStruct_attributes));
PARROT_UNMANAGEDSTRUCT(clone)->init =
VTABLE_clone(INTERP, PARROT_UNMANAGEDSTRUCT(SELF)->init);
View
4 src/spf_render.c
@@ -364,7 +364,7 @@ canonicalize_exponent(ARGMOD(char *tc), ARGIN(const SpfInfo *info))
? len - non0_pos
: exp_digits + (len - last_pos - 1);
- mem_sys_memmove(&tc[sign_pos+1], &tc[len - keep], keep+1);
+ memmove(&tc[sign_pos+1], &tc[len - keep], keep+1);
len = sign_pos + 1 + keep;
/* If it's a fixed-width field and we're too short now,
@@ -381,7 +381,7 @@ canonicalize_exponent(ARGMOD(char *tc), ARGIN(const SpfInfo *info))
}
else {
size_t i;
- mem_sys_memmove(&tc[info->width - len], &tc[0], len+1);
+ memmove(&tc[info->width - len], &tc[0], len+1);
for (i = 0; i < info->width - len; ++i)
tc[i] = (info->flags & FLAG_ZERO) ? '0' : ' ';
}
View
24 src/string/api.c
@@ -352,7 +352,7 @@ Parrot_str_clone(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
Parrot_gc_allocate_string_storage(interp, result, alloc_size);
/* and copy it over */
- mem_sys_memcopy(result->strstart, s->strstart, alloc_size);
+ memcpy(result->strstart, s->strstart, alloc_size);
}
result->bufused = alloc_size;
@@ -498,7 +498,7 @@ Parrot_str_concat(PARROT_INTERP, ARGIN_NULLOK(const STRING *a),
PObj_is_string_copy_CLEAR(dest);
/* Append b */
- mem_sys_memcopy(dest->strstart + dest->bufused,
+ memcpy(dest->strstart + dest->bufused,
b->strstart, b->bufused);
dest->encoding = enc;
@@ -516,10 +516,10 @@ Parrot_str_concat(PARROT_INTERP, ARGIN_NULLOK(const STRING *a),
dest->encoding = enc;
/* Copy A first */
- mem_sys_memcopy(dest->strstart, a->strstart, a->bufused);
+ memcpy(dest->strstart, a->strstart, a->bufused);
/* Tack B on the end of A */
- mem_sys_memcopy((void *)((ptrcast_t)dest->strstart + a->bufused),
+ memcpy((void *)((ptrcast_t)dest->strstart + a->bufused),
b->strstart, b->bufused);
}
@@ -675,7 +675,7 @@ Parrot_str_new_init(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), UINTVAL len
Parrot_gc_allocate_string_storage(interp, s, len);
if (buffer && len) {
- mem_sys_memcopy(s->strstart, buffer, len);
+ memcpy(s->strstart, buffer, len);
s->bufused = len;
STRING_scan(interp, s);
}
@@ -1029,7 +1029,7 @@ Parrot_str_repeat(PARROT_INTERP, ARGIN(const STRING *s), UINTVAL num)
char * destpos = dest->strstart;
const char * const srcpos = s->strstart;
for (i = 0; i < num; ++i) {
- mem_sys_memcopy(destpos, srcpos, length);
+ memcpy(destpos, srcpos, length);
destpos += length;
}
@@ -1285,14 +1285,14 @@ Parrot_str_replace(PARROT_INTERP, ARGIN(const STRING *src),
dest->bufused = buf_size;
/* Copy begin of string */
- mem_sys_memcopy(dest->strstart, src->strstart, start_byte);
+ memcpy(dest->strstart, src->strstart, start_byte);
/* Copy the replacement in */
- mem_sys_memcopy((char *)dest->strstart + start_byte, rep->strstart,
+ memcpy((char *)dest->strstart + start_byte, rep->strstart,
rep->bufused);
/* Copy the end of old string */
- mem_sys_memcopy((char *)dest->strstart + start_byte + rep->bufused,
+ memcpy((char *)dest->strstart + start_byte + rep->bufused,
(char *)src->strstart + end_byte,
src->bufused - end_byte);
@@ -2271,7 +2271,7 @@ Parrot_str_pin(SHIM_INTERP, ARGMOD(STRING *s))
const size_t size = Buffer_buflen(s);
char * const memory = (char *)mem_internal_allocate(size);
- mem_sys_memcopy(memory, Buffer_bufstart(s), size);
+ memcpy(memory, Buffer_bufstart(s), size);
Buffer_bufstart(s) = memory;
s->strstart = memory;
@@ -2317,7 +2317,7 @@ Parrot_str_unpin(PARROT_INTERP, ARGMOD(STRING *s))
Parrot_block_GC_sweep(interp);
Parrot_gc_allocate_string_storage(interp, s, size);
Parrot_unblock_GC_sweep(interp);
- mem_sys_memcopy(Buffer_bufstart(s), memory, size);
+ memcpy(Buffer_bufstart(s), memory, size);
/* Mark the memory as neither immobile nor system allocated */
PObj_sysmem_CLEAR(s);
@@ -2533,7 +2533,7 @@ Parrot_str_escape_truncate(PARROT_INTERP,
dp = result->strstart;
}
- mem_sys_memcopy(dp + i, hex_buf, hex_len);
+ memcpy(dp + i, hex_buf, hex_len);
/* adjust our insert idx */
i += hex_len;

0 comments on commit 8213cff

Please sign in to comment.
Something went wrong with that request. Please try again.