~ubuntu-branches/ubuntu/raring/parrot/raring-proposed

« back to all changes in this revision

Viewing changes to src/gc/string_gc.c

  • Committer: Bazaar Package Importer
  • Author(s): Allison Randal
  • Date: 2011-07-30 18:45:03 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110730184503-34d4mprtfx6pt5h3
Tags: 3.6.0-1
* New upstream release
* debian/watch:
  - Modified regular expression to capture numbered directory name
    (patch from Dominique Dumont).
* debian/rules:
  - Split build-arch and build-indep, resolving lintian warning.
  - Update path to pbc_disassemble for manpage generation (patch
    from Dominique Dumont).
* debian/patches:
  - Added patch 02_fix_perl_interpreter_path.patch, resolving
    lintian warnings.
* debian/control:
  - Added DM-Upload-Allowed field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
Copyright (C) 2010, Parrot Foundation.
 
2
Copyright (C) 2010-2011, Parrot Foundation.
3
3
 
4
4
=head1 NAME
5
5
 
38
38
 
39
39
PARROT_CANNOT_RETURN_NULL
40
40
PARROT_WARN_UNUSED_RESULT
41
 
static char * aligned_mem(SHIM(const Buffer *buffer), ARGIN(char *mem))
 
41
static char * aligned_mem(ARGIN(const Buffer *buffer), ARGIN(char *mem))
 
42
        __attribute__nonnull__(1)
42
43
        __attribute__nonnull__(2);
43
44
 
44
45
static void alloc_new_block(
126
127
        __attribute__nonnull__(1);
127
128
 
128
129
#define ASSERT_ARGS_aligned_mem __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
129
 
       PARROT_ASSERT_ARG(mem))
 
130
       PARROT_ASSERT_ARG(buffer_unused) \
 
131
    , PARROT_ASSERT_ARG(mem))
130
132
#define ASSERT_ARGS_alloc_new_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
131
133
       PARROT_ASSERT_ARG(stats) \
132
134
    , PARROT_ASSERT_ARG(pool) \
665
667
PARROT_CANNOT_RETURN_NULL
666
668
PARROT_WARN_UNUSED_RESULT
667
669
static char *
668
 
aligned_mem(SHIM(const Buffer *buffer), ARGIN(char *mem))
 
670
aligned_mem(ARGIN(SHIM(const Buffer *buffer)), ARGIN(char *mem))
669
671
{
670
672
    ASSERT_ARGS(aligned_mem)
671
673
    mem += sizeof (void *);
805
807
move_buffer_callback(PARROT_INTERP, ARGIN(Buffer *b), ARGIN(void *data))
806
808
{
807
809
    ASSERT_ARGS(move_buffer_callback)
808
 
    Memory_Block *new_block = (Memory_Block *)data;
 
810
    Memory_Block * const new_block = (Memory_Block *)data;
809
811
 
810
812
    if (Buffer_buflen(b) && PObj_is_movable_TESTALL(b)) {
811
 
        Memory_Block *old_block = Buffer_pool(b);
 
813
        Memory_Block * const old_block = Buffer_pool(b);
812
814
 
813
815
        if (!is_block_almost_full(old_block))
814
816
            move_one_buffer(interp, new_block, b);
942
944
        Buffer_bufstart(old_buf) = Buffer_bufstart(hdr);
943
945
    }
944
946
    else {
945
 
        char *new_pool_ptr = aligned_mem(old_buf, pool->top);
 
947
        char * const new_pool_ptr = aligned_mem(old_buf, pool->top);
946
948
 
947
949
        /* Copy our memory to the new pool */
948
950
        memcpy(new_pool_ptr, Buffer_bufstart(old_buf), Buffer_buflen(old_buf));