Permalink
Browse files

change struct name form "Buffer" to "Parrot_Buffer" to avoid name con…

…flicts
  • Loading branch information...
1 parent ba87ba4 commit 08a15fccde6404a83cb30180aca68366bc48d042 gerd committed Oct 10, 2011
View
@@ -139,7 +139,7 @@ int Parrot_gc_active_sized_buffers(PARROT_INTERP)
PARROT_EXPORT
void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP,
- ARGOUT(Buffer *buffer),
+ ARGOUT(Parrot_Buffer *buffer),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -210,7 +210,7 @@ void Parrot_gc_finalize(PARROT_INTERP)
PARROT_EXPORT
void Parrot_gc_free_bufferlike_header(PARROT_INTERP,
- ARGMOD(Buffer *obj),
+ ARGMOD(Parrot_Buffer *obj),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
@@ -286,7 +286,7 @@ size_t Parrot_gc_mem_alloc_since_last_collect(PARROT_INTERP)
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
-Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
+Parrot_Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
__attribute__nonnull__(1);
PARROT_EXPORT
@@ -309,7 +309,7 @@ void Parrot_gc_pmc_needs_early_collection(PARROT_INTERP, ARGMOD(PMC *pmc))
PARROT_EXPORT
void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP,
- ARGMOD(Buffer *buffer),
+ ARGMOD(Parrot_Buffer *buffer),
size_t newsize)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
View
@@ -27,7 +27,7 @@ typedef struct buffer_t {
void * _bufstart; /* Pointer to start of buffer data
(not buffer prolog). */
size_t _buflen; /* Length of buffer data. */
-} Buffer;
+} Parrot_Buffer;
typedef enum Forward_flag {
Buffer_moved_FLAG = 1 << 0,
@@ -268,7 +268,7 @@ PARROT_WARN_UNUSED_RESULT
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
STRING * Parrot_str_new_from_buffer(PARROT_INTERP,
- ARGMOD(Buffer *buffer),
+ ARGMOD(Parrot_Buffer *buffer),
const UINTVAL len)
__attribute__nonnull__(1)
__attribute__nonnull__(2)
View
@@ -41,7 +41,7 @@ typedef struct string_callback_data {
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
-static const char * buffer_location(PARROT_INTERP, ARGIN(const Buffer *b))
+static const char * buffer_location(PARROT_INTERP, ARGIN(const Parrot_Buffer *b))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -54,7 +54,7 @@ static void check_memory_system(ARGIN(const Memory_Pools *mem_pools))
static void check_var_size_obj_pool(ARGIN(const Variable_Size_Pool *pool))
__attribute__nonnull__(1);
-static void debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
+static void debug_print_buf(PARROT_INTERP, ARGIN(const Parrot_Buffer *b))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -146,7 +146,7 @@ string C<"???">.
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static const char *
-buffer_location(PARROT_INTERP, ARGIN(const Buffer *b))
+buffer_location(PARROT_INTERP, ARGIN(const Parrot_Buffer *b))
{
ASSERT_ARGS(buffer_location)
Parrot_Context * const ctx = CONTEXT(interp);
@@ -166,7 +166,7 @@ buffer_location(PARROT_INTERP, ARGIN(const Buffer *b))
/*
-=item C<static void debug_print_buf(PARROT_INTERP, const Buffer *b)>
+=item C<static void debug_print_buf(PARROT_INTERP, const Parrot_Buffer *b)>
Prints a debug statement with information about the given PObj C<b>.
@@ -175,7 +175,7 @@ Prints a debug statement with information about the given PObj C<b>.
*/
static void
-debug_print_buf(PARROT_INTERP, ARGIN(const Buffer *b))
+debug_print_buf(PARROT_INTERP, ARGIN(const Parrot_Buffer *b))
{
ASSERT_ARGS(debug_print_buf)
fprintf(stderr, "found %p, len %d, flags 0x%08x at %s\n",
@@ -385,7 +385,7 @@ check_var_size_obj_pool(ARGIN(const Variable_Size_Pool *pool))
/*
-=item C<void check_buffer_ptr(Buffer * pobj, Variable_Size_Pool * pool)>
+=item C<void check_buffer_ptr(Parrot_Buffer * pobj, Variable_Size_Pool * pool)>
Checks wether the buffer is within the bounds of the memory pool
@@ -394,7 +394,7 @@ Checks wether the buffer is within the bounds of the memory pool
*/
void
-check_buffer_ptr(ARGMOD(Buffer * pobj), ARGMOD(Variable_Size_Pool * pool))
+check_buffer_ptr(ARGMOD(Parrot_Buffer * pobj), ARGMOD(Variable_Size_Pool * pool))
{
ASSERT_ARGS(check_buffer_ptr)
Memory_Block * cur_block = pool->top_block;
View
@@ -394,7 +394,7 @@ Parrot_gc_free_string_header(PARROT_INTERP, ARGMOD(STRING *s))
/*
-=item C<Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)>
+=item C<Parrot_Buffer * Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)>
Returns a new buffer-like header from the appropriate sized pool.
A "bufferlike object" is an object that is considered to be isomorphic to the
@@ -408,7 +408,7 @@ to create ListChunk objects in src/list.c.
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
-Buffer *
+Parrot_Buffer *
Parrot_gc_new_bufferlike_header(PARROT_INTERP, size_t size)
{
ASSERT_ARGS(Parrot_gc_new_bufferlike_header)
@@ -429,7 +429,7 @@ it and use it again.
PARROT_EXPORT
void
-Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj),
+Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Parrot_Buffer *obj),
size_t size)
{
ASSERT_ARGS(Parrot_gc_free_bufferlike_header)
@@ -438,10 +438,10 @@ Parrot_gc_free_bufferlike_header(PARROT_INTERP, ARGMOD(Buffer *obj),
/*
-=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, Buffer
+=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, Parrot_Buffer
*buffer, size_t size)>
-Allocates a chunk of memory of at least size C<size> for the given Buffer.
+Allocates a chunk of memory of at least size C<size> for the given Parrot_Buffer.
buffer is guaranteed to be properly aligned for things like C<FLOATVALS>,
so the size may be rounded up or down to guarantee that this alignment holds.
@@ -452,18 +452,18 @@ so the size may be rounded up or down to guarantee that this alignment holds.
PARROT_EXPORT
void
Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP,
- ARGOUT(Buffer *buffer), size_t size)
+ ARGOUT(Parrot_Buffer *buffer), size_t size)
{
ASSERT_ARGS(Parrot_gc_allocate_buffer_storage_aligned)
interp->gc_sys->allocate_buffer_storage(interp, buffer, size);
}
/*
-=item C<void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, Buffer *buffer,
+=item C<void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, Parrot_Buffer *buffer,
size_t newsize)>
-Reallocate the Buffer's buffer memory to the given size. The
+Reallocate the Parrot_Buffer's buffer memory to the given size. The
allocated buffer will not shrink. If the buffer was allocated with
L<Parrot_allocate_aligned> the new buffer will also be aligned. As with
all reallocation, the new buffer might have moved and the additional
@@ -475,7 +475,7 @@ memory is not cleared.
PARROT_EXPORT
void
-Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, ARGMOD(Buffer *buffer),
+Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, ARGMOD(Parrot_Buffer *buffer),
size_t newsize)
{
ASSERT_ARGS(Parrot_gc_reallocate_buffer_storage)
View
@@ -210,11 +210,11 @@ static void failed_allocation(unsigned int line, size_t size);
PARROT_MALLOC
PARROT_CAN_RETURN_NULL
-static Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, size_t size)
+static Parrot_Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, size_t size)
__attribute__nonnull__(1);
static void gc_gms_allocate_buffer_storage(PARROT_INTERP,
- ARGIN(Buffer *str),
+ ARGIN(Parrot_Buffer *str),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -288,7 +288,7 @@ static void gc_gms_finalize(PARROT_INTERP)
__attribute__nonnull__(1);
static void gc_gms_free_buffer_header(PARROT_INTERP,
- ARGFREE(Buffer *s),
+ ARGFREE(Parrot_Buffer *s),
size_t size)
__attribute__nonnull__(1);
@@ -390,7 +390,7 @@ static void gc_gms_process_work_list(PARROT_INTERP,
__attribute__nonnull__(3);
static void gc_gms_reallocate_buffer_storage(PARROT_INTERP,
- ARGIN(Buffer *str),
+ ARGIN(Parrot_Buffer *str),
size_t size)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -1118,7 +1118,7 @@ gc_gms_sweep_pools(PARROT_INTERP, ARGMOD(MarkSweep_GC *self))
else if (!PObj_constant_TEST(str)) {
Parrot_pa_remove(interp, self->strings[i], item->ptr);
if (Buffer_bufstart(str) && !PObj_external_TEST(str))
- Parrot_gc_str_free_buffer_storage(interp, &self->string_gc, (Buffer*)str);
+ Parrot_gc_str_free_buffer_storage(interp, &self->string_gc, (Parrot_Buffer*)str);
interp->gc_sys->stats.memory_used -= sizeof (STRING);
@@ -1229,10 +1229,10 @@ size_t size)>
=item C<static void gc_gms_reallocate_string_storage(PARROT_INTERP, STRING *str,
size_t size)>
-=item C<static void gc_gms_allocate_buffer_storage(PARROT_INTERP, Buffer *str,
+=item C<static void gc_gms_allocate_buffer_storage(PARROT_INTERP, Parrot_Buffer *str,
size_t size)>
-=item C<static void gc_gms_reallocate_buffer_storage(PARROT_INTERP, Buffer *str,
+=item C<static void gc_gms_reallocate_buffer_storage(PARROT_INTERP, Parrot_Buffer *str,
size_t size)>
=item C<static void* gc_gms_allocate_fixed_size_storage(PARROT_INTERP, size_t
@@ -1499,10 +1499,10 @@ gc_gms_is_pmc_ptr(PARROT_INTERP, ARGIN_NULLOK(void *ptr))
=item C<gc_gms_free_string_header(PARROT_INTERP, STRING *s)>
-=item C<static Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, size_t
+=item C<static Parrot_Buffer* gc_gms_allocate_buffer_header(PARROT_INTERP, size_t
size)>
-=item C<static void gc_gms_free_buffer_header(PARROT_INTERP, Buffer *s, size_t
+=item C<static void gc_gms_free_buffer_header(PARROT_INTERP, Parrot_Buffer *s, size_t
size)>
Allocate/free string/buffer headers.
@@ -1549,7 +1549,7 @@ gc_gms_free_string_header(PARROT_INTERP, ARGFREE(STRING *s))
if (Buffer_bufstart(s) && !PObj_external_TEST(s))
Parrot_gc_str_free_buffer_storage(interp,
- &self->string_gc, (Buffer *)s);
+ &self->string_gc, (Parrot_Buffer *)s);
PObj_on_free_list_SET(s);
@@ -1563,15 +1563,15 @@ gc_gms_free_string_header(PARROT_INTERP, ARGFREE(STRING *s))
PARROT_MALLOC
PARROT_CAN_RETURN_NULL
-static Buffer*
+static Parrot_Buffer*
gc_gms_allocate_buffer_header(PARROT_INTERP, SHIM(size_t size))
{
ASSERT_ARGS(gc_gms_allocate_buffer_header)
- return (Buffer*)gc_gms_allocate_string_header(interp, 0);
+ return (Parrot_Buffer*)gc_gms_allocate_string_header(interp, 0);
}
static void
-gc_gms_free_buffer_header(PARROT_INTERP, ARGFREE(Buffer *s), SHIM(size_t size))
+gc_gms_free_buffer_header(PARROT_INTERP, ARGFREE(Parrot_Buffer *s), SHIM(size_t size))
{
ASSERT_ARGS(gc_gms_free_buffer_header)
gc_gms_free_string_header(interp, (STRING*)s);
@@ -1624,10 +1624,10 @@ size)>
=item C<void gc_gms_reallocate_string_storage(PARROT_INTERP, STRING *str, size_t
size)>
-=item C<void gc_gms_allocate_buffer_storage(PARROT_INTERP, Buffer *str, size_t
+=item C<void gc_gms_allocate_buffer_storage(PARROT_INTERP, Parrot_Buffer *str, size_t
size)>
-=item C<void gc_gms_reallocate_buffer_storage(PARROT_INTERP, Buffer *str, size_t
+=item C<void gc_gms_reallocate_buffer_storage(PARROT_INTERP, Parrot_Buffer *str, size_t
size)>
Functions for allocating strings/buffers storage.
@@ -1656,7 +1656,7 @@ gc_gms_reallocate_string_storage(PARROT_INTERP, ARGIN(STRING *str), size_t size)
}
static void
-gc_gms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size)
+gc_gms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Parrot_Buffer *str), size_t size)
{
ASSERT_ARGS(gc_gms_allocate_buffer_storage)
MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private;
@@ -1666,7 +1666,7 @@ gc_gms_allocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size)
}
static void
-gc_gms_reallocate_buffer_storage(PARROT_INTERP, ARGIN(Buffer *str), size_t size)
+gc_gms_reallocate_buffer_storage(PARROT_INTERP, ARGIN(Parrot_Buffer *str), size_t size)
{
ASSERT_ARGS(gc_gms_reallocate_buffer_storage)
MarkSweep_GC * const self = (MarkSweep_GC *)interp->gc_sys->gc_private;
@@ -1697,7 +1697,7 @@ gc_gms_iterate_live_strings(PARROT_INTERP,
for (i = 0; i < MAX_GENERATIONS; i++) {
POINTER_ARRAY_ITER(self->strings[i],
STRING *s = &((string_alloc_struct *)ptr)->str;
- callback(interp, (Buffer *)s, data););
+ callback(interp, (Parrot_Buffer *)s, data););
}
}
Oops, something went wrong.

0 comments on commit 08a15fc

Please sign in to comment.